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
set nocompatible | |
syntax enable | |
set showmode | |
set hlsearch | |
set backspace =2 | |
set visualbell | |
set cursorline | |
set smartindent | |
set number | |
set ruler |
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 | |
# | |
# Get a url from stdin, parse it and return a list of potential rss/xml/atom feed URLs in it | |
from bs4 import BeautifulSoup | |
import requests | |
import sys | |
def main(): | |
stdin=sys.stdin.readlines()[0].strip() |
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
TARGET=/some/dir | |
CRYPTO_DEVICE_NAME=/dev/mapper/crypto_super_secure | |
LVM_VOLUME=/dev/SOMETHING/SOME_LVM_VOLUME | |
# | |
echo "Unmounting $TARGET" | |
umount $TARGET | |
echo "Extending" | |
lvextend -L +100g $LVM_VOLUME | |
echo "Resizing crypto" | |
cryptsetup --verbose resize $CRYPTO_DEVICE_NAME |
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
sudo killall -HUP mDNSResponder |
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
# running ad-hoc ansible commands | |
ansible some-host-name-* -S -m shell -a "lastlog -t 60" |
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
# | |
# add this to your /etc/udev/rules.d | |
# | |
# then run "udevadm control --reload-rules" | |
# and your flash will be automounted whenever you insert it | |
ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", SYMLINK+="usbflash-adata%n" | |
ACTION=="add", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/mkdir -p /mnt/usbflash-adata%n" | |
ACTION=="add", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/mount /dev/%k /mnt/usbflash-adata%n" |
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 "cleaning up apt cache" | |
sudo apt-get clean | |
sudo /etc/init.d/rsyslog stop | |
echo "Removing old logs" | |
sudo find /var/log -type f -delete | |
echo "Zeroing out disk" | |
sudo dd if=/dev/zero of=/zero bs=1M | |
echo "Removing zero file" | |
sudo rm -v /zero |
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
23513 ping 1420611042.842872 CALL connect(0x4,0x202092630,0x10) | |
23513 ping 1420611042.842878 STRU struct sockaddr { AF_INET, 10.0.1.1:53 } | |
23513 ping 1420611042.842890 RET connect 0 | |
23513 ping 1420611042.842896 CALL sendto(0x4,0x202091800,0x1e,0,0,0) | |
23513 ping 1420611042.843135 GIO fd 4 wrote 30 bytes | |
"\M-`\M-m\^A\0\0\^A\0\0\0\0\0\0\bsuperduperdomain\^Ccom\0\0\^A\0\^A" | |
23513 ping 1420611042.843146 RET sendto 30/0x1e | |
23513 ping 1420611042.843155 CALL poll(0x7f7fffff9440,0x1,0x1388) | |
23513 ping 1420611047.846041 RET poll 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.provision :shell, inline: "apt-get update; apt-get -y upgrade" | |
config.vm.box = "fxlv/debian_wheezy64" |
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
/* | |
* ns == current nameserver index (eg. 1,2 or 3) | |
* statp->retrans == retransmition time interval (this is defined in resolv.h) | |
* | |
* do a bitwise shift to the left to get the new timeout | |
* if ns == 0 then this does nothing | |
*/ | |
int seconds = (statp->retrans << ns); | |
if (ns > 0) | |
// divide the time that was calculated after the bitwise shift by the nameserver count |
OlderNewer