This file contains 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
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 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 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 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 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 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 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') |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jul 05 11:53:20 2017 | |
Can we get json to do the same tricks as xml, and then pull into mongodb for reporting | |
ORCID public data files are tar.gz with all json serially before xml, so can speed the process a wee bit by using the json | |
The real question is whether the json library is quicker with json, than ETree is with xml | |
NB: version 2.0 of ORCID schema | |
@author: Jason |
This file contains 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 | |
## post-update hook recieves a list of all updated refs | |
for r in "$@"; do | |
case $r in | |
refs/heads/*) git --work-tree=$HOME --git-dir=$HOME/repo.git checkout -f $(git rev-parse --symbolic --abbrev-ref $r) | |
esac | |
done | |
cd $HOME | |
docker-compose restart |
This file contains 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
# removed dangling imagese: | |
docker rmi -f $(docker images -qf dangling=true) |
NewerOlder