Skip to content

Instantly share code, notes, and snippets.

@hub23
hub23 / youtube-dl-mp3
Last active September 29, 2018 14:33
youtube-dl wrapper for mp3 downloads
#!/bin/bash
ydlBaseString='youtube-dl --no-call-home --min-sleep-interval 0.5 --max-sleep-interval 2 --prefer-ffmpeg --extract-audio --ignore-errors --audio-format mp3 -o "%(title)s.%(ext)s"'
ydlURL="$ydlBaseString $1"
ydlList="$ydlBaseString --batch-file=$1"
if [[ $1 =~ ^http.* ]] ;then
eval $ydlURL
elif [[ $1 ]] ;then
eval $ydlList
@hub23
hub23 / hub.conf
Last active March 11, 2018 23:41
Geany Dark Theme
# Based on:
# https://github.com/codebrainz/geany-themes/blob/master/colorschemes/zenburn.conf
[theme_info]
name=hub
description=A zenburn like dark theme for geany
version=1
author=hub
url=https://gist.github.com/hub23/0144a13e68dbe26cda6f8d127da1edd5
# list of each compatible Geany release version
@hub23
hub23 / eclipse
Created November 22, 2017 18:44
Run Eclipse Oxygen in Dark Themes with correct Icons
#!/bin/bash
export SWT_GTK3=0 \
&& cd /foo/bar/eclipse/java-oxygen/eclipse/ \
&& /foo/bar/eclipse/java-oxygen/eclipse/eclipse
@hub23
hub23 / config
Created November 22, 2017 18:43
Terminator Config
[global_config]
window_state = maximise
enabled_plugins = CustomCommandsMenu, InactivityWatch, ActivityWatch, APTURLHandler
title_inactive_fg_color = "#afafaf"
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#4c4c4c"
title_inactive_bg_color = "#2d2d2d"
[keybindings]
broadcast_all = <Super>F9
broadcast_off = <Super>F10
@hub23
hub23 / slimfit.sh
Last active November 22, 2017 18:53 — forked from samatjain/Slim-Raspbian.sh
Shrink Raspbian Installation
#!/bin/bash
date
df -h
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
@hub23
hub23 / dropbox workaround
Created August 23, 2016 18:43
Dropbox xfce4-panel Icon Bug Workaround
#!/bin/bash
dropbox stop
DBUS_SESSION_BUS_ADDRESS=""
dropbox start
@hub23
hub23 / zsh theme
Last active December 1, 2019 16:44
Custom ZSH Theme
# user colors
if [ $UID -eq 0 ]; then USERCOLOR="red"; else USERCOLOR="green"; fi
# box name
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# workdir
local current_dir='${PWD/#$HOME/~}'
@hub23
hub23 / aliases
Last active May 25, 2017 08:49
Shell Config Snippets
# ssh settings for x session
alias ssh-xcomp="ssh -XC -c blowfish-cbc,arcfour"
# ssh socks proxy
alias ssh-socks="ssh -D 1080"
# apt-get update, upgrade, dist-upgrade, clean, autoremove
alias update-full="sudo apt-get -qyf install \
&& sudo dpkg --configure -a \
&& sudo apt-get -qy update \