Skip to content

Instantly share code, notes, and snippets.

View xazax's full-sized avatar
:bowtie:
Working from home

Daniel xazax

:bowtie:
Working from home
  • Stockholm, Sweden
View GitHub Profile
@xazax
xazax / gist:972349
Created May 14, 2011 16:08
Bash completion for todo.txt - stolen from todo.txt wiki.
We couldn’t find that file to show.
#!/bin/bash
sudo rfkill block all && sudo rfkill unblock all;
sudo netcfg -a && sudo netcfg wifi;
echo "Acquired address `ifconfig|awk '/192.168/ {print $2}'`";
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xazax
xazax / hosthost.sh
Created June 30, 2012 16:19
Reverse hosting
#!/usr/bin/env bash
host `host $1|grep has| awk '{print $4}'`
@xazax
xazax / testgist.md
Created July 21, 2012 17:46
A sample post for gist.io

Header

Some Lorum hipsum.

Another header

Moar text.

tmux cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@xazax
xazax / cronlog.sh
Created August 1, 2012 11:35
Wrapper for loggin timedate from cronscripts.
#!/bin/sh
DATEFORMAT=`date +%F\ %H:%M`
echo "[$DATEFORMAT] Start executing $1"
$@ 2>&1 | sed -e "s/\(.*\)/[$DATEFORMAT] \1/"
echo "[$DATEFORMAT] End executing $1"
@xazax
xazax / ubuntu-bleedingedge
Last active December 22, 2015 01:39
What could possible go wrong?
#!/usr/bin/env bash
logger -t bleedingedge "### Starting automated upgrade with package update ###"
logger -t bleedingedge "(running 'aptitude update' and 'aptitude upgrade -y')"
aptitude update 2>&1 >/dev/null | logger -t bleedingedge
aptitude upgrade -y|logger -t bleedingedge
logger -t bleedingedge "## Ended automated upgrade to bleeding edge software ###"
@xazax
xazax / screenshot-select
Created January 3, 2019 17:43 — forked from seanbeaton/screenshot-select
create-screenshot-scrot
#!/bin/bash
# Clear clipboard (can't be pasting any passwords if we try to paste too fast).
echo "" | xclip -selection clipboard
mkdir -p $HOME/Dropbox/shots/
TSTAMP=`date '+%Y-%m-%d-%H-%M-%S'`
IMAGEPATH=$HOME/Dropbox/shots/Screenshot-$TSTAMP.png