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
Sometimes while compiling you might face this error on OSX. I faced this on Mountain Lion `10.8.5`. | |
This happens because `freetype` library headers are not found in standard place. To solve this follow the follwing steps. | |
1. Install `freetype` using [brew](http://brew.sh) | |
brew install fretype | |
2. Now you'll see a `freetype2` directory exists in `/usr/local/include`. | |
3. But `freetype` is required. So create a symlink | |
ln -s freetype2 freetype |
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/bash | |
echo $(date +"%Y-%m-%d %H:%M:%S") $* | tee -a ~/task.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
/********************************************************************\ | |
* BitlBee -- An IRC to other IM-networks gateway * | |
* * | |
* Copyright 2002-2006 Wilmer van der Gaast and others * | |
\********************************************************************/ | |
/* | |
* Storage backend that uses an MySQL. | |
* Sample schema can be found on /doc/schema_mysql.sql | |
*/ |
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
""" | |
Scan for keys with a pattern in Redis. It uses SCAN command instead of KEYS. | |
KEYS is dangereros as it locks down the whole server. Hence the need for SCAN | |
Usage: | |
python scanpattern.py redis.myserver.com 'KEY-PATTERN-TO-SEARCH' | |
""" |
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/bash | |
IP_SOURCE=PrivateIpAddress | |
aws ec2 describe-instances --output text \ | |
--query 'Reservations[*].Instances[*].{ip:['$IP_SOURCE'],name:Tags[?Key==`Name`].Value}' \ | |
--filter "Name=tag:Name,Values=$1" | | |
awk '$1 ~ /IP/{ip=$2} $1 ~ /NAME/{printf "%-15s %s\n", ip, $2}' | | |
sort -k2 |
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
goinside(){ | |
docker exec -it $1 bash -c "stty cols $COLUMNS rows $LINES && bash"; | |
} | |
_goinside(){ | |
COMPREPLY=( $(docker ps --format "{{.Names}}" -f name=$2) ) | |
} | |
export -f goinside | |
export -f _goinside | |
complete -F _goinside goinside |
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
import argparse | |
import re | |
from datetime import datetime | |
from signal import signal, SIGPIPE, SIG_DFL | |
from operator import itemgetter | |
signal(SIGPIPE, SIG_DFL) | |
def test_sorted_lines(): |
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 python3.7 | |
""" | |
Shows changes in product information from CSV files. | |
""" | |
from typing import Dict, List, Tuple, Set, Any, Hashable | |
import argparse | |
import csv | |
import logging | |
import logging.config | |
import sys |
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
""" | |
stoptest.py | |
Run it with zerorpc. To close press Ctrl+C or send a TERM or INT signal. | |
""" | |
import zerorpc | |
import time | |
import signal | |
import sys | |
import itertools |