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
# To set the same options for a block of harddisks, do so with something | |
# like the following example options: | |
# harddisks="/dev/hda /dev/hdb" | |
# hdparm_opts="-d1 -X66" | |
# This is run before the configuration in hdparm.conf. Do not use | |
# this arrangement if you need modules loaded for your hard disks, | |
# or need udev to create the nodes, or have some other local quirk | |
# These are better addressed with the options in /etc/hdparm.conf | |
# |
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
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#define CANARY "in_the_coal_mine" | |
struct { | |
char buffer[1024]; |
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
/* | |
setxattrs - bubbaATbubba.org | |
Properly sets sparse bundle extended attributes lost when rsyncing | |
sparse bundle data to a platform that does not support extended | |
attributes. This is only need when restoring/retrieving the | |
bundle. | |
To use, sync/copy all bundle files, then run this tool on the | |
sparse bundle: |
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
def params_to_dict(param_str): | |
splits = param_str.split(" ") | |
data = {} | |
prev_key = None | |
prev_val = None | |
for s in splits: | |
if "=" in s: | |
key, val = s.split("=") | |
if prev_key: |
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
if read proto cookie && [ -n "$DISPLAY" ]; then | |
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then | |
# X11UseLocalhost=yes | |
echo add unix:`echo $DISPLAY | | |
cut -c11-` $proto $cookie | |
else | |
# X11UseLocalhost=no | |
echo add $DISPLAY $proto $cookie | |
fi | xauth -q - | |
fi |
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
>>> a = "1.0" | |
>>> int(a) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
ValueError: invalid literal for int() with base 10: '1.0' | |
>>> int(float(a)) | |
1 | |
>>> foo = "1.0" | |
>>> int(foo) | |
Traceback (most recent call last): |
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 | |
# for each list of nodes in ISP metadata list | |
for country in metadata/by-isp/*; do | |
ccode="$(basename ${country})" | |
echo "${ccode}" | |
mkdir "by-isp/${ccode}" | |
# from node list for each country, create file with only tests from said country | |
pattern=$(awk '{ print $2 }' "${country}" \ |
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
[root@dev-aje:~]# apt-cache --help | grep -- depends | |
depends - Show raw dependency information for a package | |
rdepends - Show reverse dependency information for a package | |
[root@dev-aje:~]# apt-cache depends libpng12-0 | |
libpng12-0 | |
Depends: libc6 | |
Depends: zlib1g | |
PreDepends: multiarch-support | |
Conflicts: libpng12-dev | |
Conflicts: <mzscheme> |
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/python3.4 | |
import math | |
import statistics as stats | |
import signal | |
import sys | |
from os.path import basename | |
# Hide stack trace from KeyboardInterrupt |
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
jenders@jenders-mba tmp :) $ cat ./foo.sh | |
#!/bin/bash | |
echo "\$@: $@" | |
flags=() | |
for flag in "$@"; do | |
if [[ "${flag}" =~ ^- ]]; then | |
flags=("${flags[@]}" "${flag}") | |
fi |