Skip to content

Instantly share code, notes, and snippets.

@g-P
g-P / eloquent_chapters.links
Created July 30, 2014 13:48
Eloquent Javascript
@cgarvis
cgarvis / vbox
Created October 12, 2011 14:29
Commandline for starting/stopping vboxes in headless mode
#!/bin/sh
E_NOARGS=85
if [[ -z "$1" || -z "$2" ]]; then
[[ "$1" == "list" ]] || ( echo "Usage: `basename $0` [list|start|pause|stop] vm-name"; exit $E_NOARGS; )
fi
case $1 in
"list" | "ls" )
@jaapz
jaapz / cb-exit.py
Last active November 1, 2015 23:00
cb-exit for crunchbang with jessie repo's
#!/usr/bin/env python
# Replace the old /usr/bin/cb-exit with this one.
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
@darekkay
darekkay / putty-eclectide.reg
Last active February 9, 2022 09:10
Eclectide color theme for the Putty SSH client
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\SESSION_NAME]
; Default Foreground
"Colour0"="217,216,216"
; Default Bold Foreground
"Colour1"="217,216,216"
; Default Background
"Colour2"="28,28,28"
@dcloud9
dcloud9 / stripdown-debian.sh
Created February 10, 2014 16:07
How-to Strip Down Debian Distro
#! /bin/bash
# Should be run on a vanilla Debian install.
# This script will strip it down to bare minimum and yet bootable distro.
# Simulated run onlyi (--simulate). Uncomment this and Comment out the "Real Deal".
#apt-get --simulate purge $(dpkg-query -Wf '${Package;-40}${Essential}${Priority}\n'|awk '$2 ~ /nooptional|noextra/ {print $1}'|grep -v -E 'anacron|busybox|initramfs-tools|insserv|klibc-utils|libklibc|libsemanage-common|libsemanage1|libustr-1.0-1|libuuid-perl|linux-base|linux-image')
# Real deal.
apt-get purge $(dpkg-query -Wf '${Package;-40}${Essential}${Priority}\n'|awk '$2 ~ /nooptional|noextra/ {print $1}'|grep -v -E 'anacron|busybox|initramfs-tools|insserv|klibc-utils|libklibc|libsemanage-common|libsemanage1|libustr-1.0-1|libuuid-perl|linux-base|linux-image')
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@devadvance
devadvance / .bashrc
Created February 28, 2021 20:31
Convenient ffmpeg shell functions
#######################################
# Displays a yes/no prompt to continue that repeats until input matches.
# Arguments:
# $1 - (optional) a string representing the yes/no question to ask
# $2 - (optional) a string representing the prompt style.
# Returns:
# 0 to proceed further (indicates "yes"), 1 to stop (indicates "no").
#######################################
continue_prompt() {
local prompt default reply
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active March 9, 2024 07:54
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@rmlrml
rmlrml / playlist.sh
Last active April 9, 2024 10:15 — forked from scarlson/playlist.sh
Bash script to create .m3u playlist files for all mp3s in subdirectories
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson (stevengcarlson@gmail.com)
find . -type d |
while read -r subdir
do
rm -f "$subdir"/*.m3u