This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use input redirection. Copies straight to clipboard. | |
# Can paste into spreadsheet applications directly. | |
# MIT licensed. | |
gawk ' | |
BEGIN { FPAT = "([^,]*)|(\"[^\"]+\")" } | |
NR>1 { print "" } | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################ | |
############ also be sure to RESTART OpenProject after replacing the file. ################ | |
############ it doesn't show that enterprise mode is enabled in the settings, but all ################ | |
############ enterprise mode features, such as KanBan boards, are enabled. ################ | |
#-- copyright | |
# OpenProject is an open source project management software. | |
# Copyright (C) 2012-2023 the OpenProject GmbH | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License version 3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Copyright (c) 2020 Mark Polyakov | |
;; Released under the WTFPL (Do What The Fuck You Want To Public License) | |
(defvar *html-void-tags* '(:area :base :br :col :embed :hr :img :input :link | |
:meta :param :source :track :wbr) | |
"String designators for self-closing/void tags. | |
https://html.spec.whatwg.org/multipage/syntax.html#void-elements") | |
(defvar *html-escapes* | |
'(#\> ">" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file is released under the GNU Public License v3 | |
# ACM scraper during coronavirus | |
# Will skip existing PDFs to speed up a resumed download | |
# Get the link to the first issue in the journal/SIG/etc, then the scraper will use "next" links to traverse | |
# Usage: ./acm.bash first_issue_link output_dir | |
# Eg, ./acm.bash https://dl.acm.org/toc/siggraph/1969/3/3 /media/mass/siggraph to download all SIGGRAPH PDFs | |
# note: acm does BLOCK IPs after a few hundred PDFs! Uncommenting the sleep statement below to slow things down may help, but I haven't tested |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json = JSON.parse(require('fs').readFileSync('/tmp/memes', 'utf8'); | |
filter = json.filter(c=>c.points>60000); | |
min = json.sort((a,b)=>a-b)[0].points; | |
sum = json.reduce((a,b)=>a+b.points, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# USAGE: | |
# `backup-wordpress user@host /sth/backups-dir` (usually root) | |
# optional environment variables: | |
# WP_DB: Name of the wordpress database (default: wordpress). | |
# WP_DB_USER: User for the mysql database (default: root). | |
# WP_DB_PASSWORD: Password for mysql database (defaults to prompting). | |
# WP_WWW: Path to the wordpress files (remotely). Should be direct to the `wordpress` directory, not the general public html one (default: /var/www/wordpress). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Copyright (c) Mark Polyakov 2018 | |
# Released under the GNU GPL version 3 | |
use strict; | |
use warnings; | |
use v5.14; | |
use Cwd 'abs_path'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$#" != 4 ] | |
then | |
echo 'USAGE: number.sh ~/my-phone-number 12065555555 o o' | |
exit 1 | |
fi | |
echo -n "$3" > "$1" | |
base32 < /dev/urandom | tr A-Z0-9\\n a-za-z | tr -d '=' | head -c $["$2"-2] >> "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $(xdotool search --class Konsole) | |
do | |
xdotool windowactivate --sync "$i" type "$1" | |
xdotool windowactivate --sync "$i" key Return | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# help text | |
[[ $1 == *-h* || -z $1 ]] && echo 'Usage: mnemonic.sh word_count [min_length max_length]' && exit | |
# Where is the wordlist? | |
[[ -e /usr/dict/words ]] && dict_path='/usr/dict/words' || dict_path='/usr/share/dict/words' | |
# Remove words with apostrophes, capitalization, or outside the correct length range | |
sed -r "/^[a-z]{${2:-5},${3:-8}}$/!d" "$dict_path" > /tmp/mnemonic-words | |
word_count=$(wc -l < /tmp/mnemonic-words) | |
# print estimated entropy per word |
NewerOlder