Skip to content

Instantly share code, notes, and snippets.

View heyalexej's full-sized avatar

Alexej heyalexej

  • rather hard to pin down
View GitHub Profile
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@heyalexej
heyalexej / filesfromlist.sh
Created February 7, 2014 15:39
Create file names from input file.
while read line; do touch $(echo -n "$line").myfilextension; done < input.csv
@heyalexej
heyalexej / batchdownloadhashrename.sh
Created February 12, 2014 22:57
Dirtiest Download Script in the World!
#!/bin/bash
# check for directories and create if non-existent.
for i in lala lulu
do
if [ -d $i ]; then
echo "Cool. Directory $i exists."
else
echo "Directory $i didn't exist so I knitted one for ya!"
mkdir $i
@heyalexej
heyalexej / statuscodes.sh
Created February 19, 2014 12:28
Check status codes for a list of URLs
while read LINE; do curl -o /dev/null --head --silent --write-out "$LINE\t %{http_code}\n" "$LINE"; done < inputfile 2>&1 | tee outputfile

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@heyalexej
heyalexej / dpkgdump.sh
Created April 27, 2014 22:08
Log Of All Installed .deb Packages
#!/bin/bash -e
# dpkgdump.sh
# creates text file with a list of all packages installed by date
TMP0=`mktemp "${TMPDIR:-/tmp}"/dpkgdump.col.XXXXXXXXXX`
TMP1=`mktemp "${TMPDIR:-/tmp}"/dpkgdump.res.XXXXXXXXXX`
# next append current log
find /var/log -maxdepth 1 -type f -regex ".*\dpkg\.log\.[0-9].gz$" | xargs zcat > $TMP0
@heyalexej
heyalexej / zipuproot.sh
Created May 3, 2014 12:44
zips up your entire machine from root, considers excludes
#!/bin/sh
DATE=`date +%Y-%m-%d-d%`
ARCH=`uname -m`
HOSTNAME=`uname -n`
ROOTFS_TYPE=`df -T / | awk '{print $2}' | grep -v "Type"`
BACKUP_PATH=`pwd`
STAGE5NAME="backup-${ARCH}-${ROOTFS_TYPE}-${HOSTNAME}-${DATE}.tar.gz"
cd /;
I've noticed on several occasions that even people who work on a computer a lot don't know about the Shell (a.k.a Terminal) on their machines.
The Shell is an incredibly powerful tool that can help you with a lot of tasks and operations in your everyday life. It can drastically improve your productivity, you can manage servers from it, crunch huge amounts of data (searching, sorting, filtering, replacing), it allows you to automate annoying tasks and so much more.
I experience a lot of confusion and insecurities about it's use. It's not remotely as scary as people perceive it to be. And that's where I want to help.
They say learning through experience is the best way to go about it. I want to invite you to an interactive workshop to play with the command line and learn some basics to get your way around it. Afterwards you will be able to incorporate it's use into your workflow.
This session is not for hackers and developers only. I invite everyone who is curious about it and wants to feel like a ninja.