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
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=16 | |
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
} |
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 | |
#------------------------------------------------------------------------------- | |
#Post Install Script for Arch Linux on the Raspberry Pi | |
#Inspired by helmuthdu https://gist.github.com/Xifax/1517721 | |
#------------------------------------------------------------------------------- | |
#This program is free software: you can redistribute it and/or modify | |
#it under the terms of the GNU General Public License as published by | |
#the Free Software Foundation, either version 3 of the License, or | |
#(at your option) any later version. | |
# |
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 | |
#------------------------------------------------------------------------------- | |
#Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com | |
#Inspired by Andreas Freitag, aka nexxx script | |
#------------------------------------------------------------------------------- | |
#This program is free software: you can redistribute it and/or modify | |
#it under the terms of the GNU General Public License as published by | |
#the Free Software Foundation, either version 3 of the License, or | |
#(at your option) any later version. | |
# |
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
from fabric.api import * | |
from fabric.contrib import project as project | |
SYNC_DIR = 'MY_DIRECTORY' | |
def push(): | |
local('rsync -avz --exclude fabfile.py --exclude fabfile.pyc . %s' % SYNC_DIR) | |
def pull(): | |
local('rsync -avz --exclude fabfile.py --exclude fabfile.pyc %s .' % SYNC_DIR) |
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
from fabric.api import env, run | |
from fabric.contrib.project import rsync_project | |
try: | |
from fabfile_local import * | |
except ImportError, e: | |
environments = { | |
"dev": { | |
"hosts": ["localhost"], | |
}, |
This file has been truncated, but you can view the full file.
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 random | |
def random_words(num, separator='-'): | |
""" | |
Return `num`-random concatinated to each other. | |
They will be joined by `separator` | |
""" | |
words = [] |
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 | |
# | |
# This script defines the public IP of Home and | |
# then checks the current public IP. If the current | |
# IP matches Home's IP, then one command is ran. | |
# If not, another command is ran. | |
# Public IP at home | |
HOME='YOUR HOME dedicated public IP address.' | |
IP=$(curl ifconfig.me/ip;) |
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=$(ip route show dev eth0 | grep link | awk '{print $7}') | |
HOME='YOUR STATIC IP AT HOME' | |
function Home() { | |
echo "You are home."; } | |
function AwayFromHome() { | |
echo "You are away from home."; } |
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/sh | |
# pm - Custom Pacman functions | |
# usage pm [option] [package(s)] | |
case $1 in | |
-i) yaourt -S "${@:2}" ;; | |
-u) yaourt -Syua "${@:2}" ;; | |
-r) sudo pacman -Rns "${@:2}" ;; | |
-s) yaourt -Ss "${@:2}" ;; | |
-q) yaourt -Qi "${@:2}" ;; | |
info) yaourt -Si "${@:2}" ;; |
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
// -------------------------------------------------- | |
// Flexbox LESS mixins | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// Flexbox display | |
// flex or inline-flex | |
.flex-display(@display: flex) { | |
display: ~"-webkit-@{display}"; | |
display: ~"-moz-@{display}"; |
OlderNewer