Skip to content

Instantly share code, notes, and snippets.

@jacobian
jacobian / pip-cache-install.py
Created May 1, 2012 05:22
Install a package from your local pip download cache without touching the 'net.
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@shimarin
shimarin / backup-remote.sh
Last active August 18, 2018 16:25
backup script using rsync and btrfs
#!/bin/bash
BACKUP_ROOT=rsync://backup.local/backup
LOGFILE=/var/log/backup.log
PIDFILE=/run/backup.pid
FAILFILE=/run/backup.fail
exec_rsync() {
local name=$1
local source=$2
rsync -avx --delete-excluded $source $BACKUP_ROOT/$name
@afrendeiro
afrendeiro / ubuntu_fresh_install.sh
Last active October 21, 2019 13:12
Software install from fresh Ubuntu 14.04 LTS image on AWS EC2
# New users
sudo adduser username
# Grant the new user sudo privileges
sudo visudo
# username ALL=(ALL:ALL) ALL
# add this line ^^
# change to that user
su - username
@it-is-michal
it-is-michal / awesome_i3wm.md
Last active January 10, 2023 20:28
My current i3wm config
@crigertg
crigertg / toggle_headset.sh
Last active September 28, 2023 09:21
Use this script to automatically connect to a bluetooth headset and switch audio profiles.
#!/bin/bash
# Use this script to automatically connect to a bluetooth headset and switch audio profiles.
# By default the script toggles the headset connection on/off and selects the handsfree profile
# when a connection is established.
# There is the possibility to switch to the ALT_MODE which ensures a connection and
# when executed again it switches between the a2dp profile for music and handsfree for using the microphone.
# The MAC address of your Bluetooth headset
# Use `bluetoothctl devices` to list your devices