I hereby claim:
- I am gesquive on github.
- I am gesquivel (https://keybase.io/gesquivel) on keybase.
- I have a public key ASB9AOb3ILKZj7j51Ya6YNtREiujK6jd3qlBW4H3wur5Qgo
To claim this, I am signing this object:
## Configure eth0 | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static | |
NAME="System eth0" |
from sh import ErrorReturnCode, git | |
from cStringIO import StringIO | |
import tarfile | |
def git_get(git_repo, git_branch, git_path, destination_path=".", use_compression=True, verbose=False): | |
git_dir = os.path.dirname(git_path) | |
git_file = os.path.basename(git_path) | |
if git_dir.replace("/", "") == git_file: | |
git_file = '' | |
if git_dir.replace("/","").strip() == "": | |
git_loc = git_branch |
import argparse | |
import ConfigParser | |
import sys | |
def main(argv=None): | |
# Do argv default this way, as doing it in the functional | |
# declaration sets it at compile time. | |
if argv is None: | |
argv = sys.argv[1]: | |
import os | |
def get_config_path(project_name=None, config_name=None): | |
''' | |
Gets the config location based on the XDG Base Directory Specification. | |
If no config is found, the home directory based path is returned. | |
''' | |
if not project_name: | |
project_name = os.path.basename(__file__).split('.')[0] | |
if not config_name: |
[ | |
"http://whatismyip.akamai.com/", | |
"http://icanhazip.com", | |
"http://wtfismyip.com/text", | |
"http://whatsmyip.me/", | |
"http://api.ipify.org/", | |
"http://ip.catnapgames.com", | |
"http://ip.ryansanden.com", | |
] |
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
# original src: https://unix.stackexchange.com/a/2146/17806 | |
# usage: authkeys-report <authorized_keys-file> | |
set -ue | |
tmp="$(mktemp -t fingerprint-authkeys.XXXXXXXX)" | |
trap 'rm -f "$tmp"' 0 |
// run a command using the shell; no need to split args | |
// from https://stackoverflow.com/questions/6182369/exec-a-shell-command-in-go | |
func runcmd(cmd string, shell bool) []byte { | |
if shell { | |
out, err := exec.Command("bash", "-c", cmd).Output() | |
if err != nil { | |
log.Fatal(err) | |
panic("some error found") | |
} | |
return out |
import subprocess | |
import sys | |
import os | |
def output_to_pager(text): | |
try: | |
# args stolen fron git source, see `man less` | |
pager = subprocess.Popen(['less', '-F', '-R', '-S', '-X', '-K'], | |
stdin=subprocess.PIPE, | |
stdout=sys.stdout) |