Create Key (no passphrase and name mirror the key)
ssh-keygen -t rsa -N "" -f ~/.ssh/mirror
class FullPaths(argparse.Action): | |
"""Expand user- and relative-paths""" | |
def __call__(self, parser, namespace, values, option_string=None): | |
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
def is_dir(dirname): | |
"""Checks if a path is an actual directory""" | |
if not os.path.isdir(dirname): | |
msg = "{0} is not a directory".format(dirname) | |
raise argparse.ArgumentTypeError(msg) |
#!/usr/bin/env python | |
# Copyright (c) 2012 Eduardo Felipe Castegnaro, http://github.com/edufelipe/ | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: |
Using Requests and Beautiful Soup, with the most recent Beautiful Soup 4 docs.
Install our tools (preferably in a new virtualenv):
pip install beautifulsoup4
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This is how I used it: | |
# $ cat ~/.bash_history | bash-history-to-zsh-history >> ~/.zsh_history | |
import sys | |
def main(): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.
Here's the code, which goes in your /etc/default/grub
file:
GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"
function reverseIp6 { | |
echo "$1" | awk -F: 'BEGIN {OFS=""; }{addCount = 9 - NF; for(i=1; i<=NF;i++){if(length($i) == 0){ for(j=1;j<=addCount;j++){$i = ($i "0000");} } else { $i = substr(("0000" $i), length($i)+5-4);}}; print}' | rev | sed -e "s/./&./g" | |
} | |
$(reverseIp6 "2001:db8:85a3::8a2e:370:7334")"ip6.arpa." | |
#Result: 4.3.3.7.0.7.3.0.e.2.a.8.0.0.0.0.0.0.0.0.3.a.5.8.8.b.d.0.1.0.0.2.ip6.arpa. |
/* lowendtalk darker & wider page theme */ | |
/* (c) Copyright by Fusl */ | |
/* version 1.0.6 */ | |
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("lowendtalk.com") { | |
/* version 1.0 */ | |
body { | |
background: #111; |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This is how I used it: | |
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history | |
import sys | |
import time |