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
-- Create email list: | |
WITH v AS (SELECT | |
'SELECT ' || C.COLUMN_NAME || ', left(' || C.COLUMN_NAME || ', 1)||left(md5(' || C.COLUMN_NAME || '), 16)||''@mailinator.com'' FROM ' || C.TABLE_NAME || CASE | |
WHEN (ROW_NUMBER() OVER ()) = 1 THEN '' | |
ELSE ' UNION ' | |
END AS st | |
FROM | |
INFORMATION_SCHEMA.COLUMNS AS C | |
WHERE | |
C.COLUMN_NAME ~ 'email' |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"time" | |
) | |
func main() { |
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
sqlite3 db.sqlite3 'pragma foreign_key_check;' | tail -n +3 | sed 's/\(\w*\)\s*\(\w*\).*/delete from \1 where id=\2;/' | sqlite3 db.sqlite3 |
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
sudo reflector -c NZ -c AU -c SG -p https -a 12 --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlist |
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
i in {6..20} ; do mkdir $(printf '%02d\n' $i) ; 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
from time import sleep | |
from queue import Queue | |
from threading import Thread | |
q = Queue(2) | |
Thread(target=lambda:(sleep(10), q.put(42))).start() | |
q.get() |
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
./apache-jmeter-4.0/bin/jmeter.sh -n -t ./load_test/simple.jmx |
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
visited = [[False] * m] * n | |
visited | |
=> [[False, False, False, False], [False, False, False, False], [False, False, False, False]] | |
visited[0] | |
=> [False, False, False, False] | |
visited[0][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
# Make sure you are collectin the time it takes to hadle the request | |
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D" combined_with_response_time | |
# CustomLog logs/access_log combined_with_response_time | |
grep -E $(cut -d\ -f 21 access_log | sort -n | tail -12 | tr -d '\r' | tr '\n' '|')99999 orcidhub_log |
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 python | |
# -*- coding: utf-8 -*- | |
HOME = os.path.join(home = expanduser("~") | |
import sys, os | |
def main(): | |
bash_history = open(os.path.join(HOME, ".bash_history"), 'r') | |
zsh_history = open(os.path.join(HOME, ".zsh_history"), 'a') |
NewerOlder