- Mount hard disk to /mnt/usb (you are strongly encouraged to use luks encryption on this disk!)
mkdir /mnt/usb/.bup && bup init -r /mnt/usb/.bup
to create and initialize a .bup directory on the USB disk. You may need to do some sudo and chmod/chgrp action depending on how your USB disk gets mounted. You'll save the actual files from backups here later.bup init
to create the core bup repo in your home directory, the index will live herebup index ~/
to index your home directorybup index /etc
to index your /etc directorybup save -n ${HOSTNAME}-etc -r /mnt/usb/.bup /etc
to save the backup of your /etc directory to your USB disk. This backup set will result in a branch named after ${HOSTNAME}-etc, so that if you backup other PCs to this same .bup directory on your USB disk, you'll be able to see each one in a separate branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libsnappy-dev | |
wget https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz | |
tar -xzf leveldb-1.9.0.tar.gz | |
cd leveldb-1.9.0 | |
make | |
sudo mv libleveldb.* /usr/local/lib | |
cd include | |
sudo cp -R leveldb /usr/local/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This is sp, the command-line Spotify controller. It talks to a running | |
# instance of the Spotify Linux client over dbus, providing an interface not | |
# unlike mpc. | |
# | |
# Put differently, it allows you to control Spotify without leaving the comfort | |
# of your command line, and without a custom client or Premium subscription. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funcs: | |
python setup.py build_ext --inplace | |
test: funcs | |
gcc -L. test.c -o test -lmyfuncs | |
clean: | |
rm -f test *.o *.so funcs.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import sqlparse.format as sqlformat | |
except ImportError: | |
def sqlformat(query, **kwargs): | |
"""Monkey patch sqlparse.format if package not installed""" | |
return query | |
def debug_query(query, engine): | |
"""Return a parametrized and formated sql query for debugging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hand_shutdown "key 290 mod1" | |
hand_capmouse "key 291 mod1" | |
hand_fullscr "key 13 mod2" | |
hand_pause "key 19 mod2" | |
hand_mapper "key 282 mod1" | |
hand_speedlock "key 293 mod2" | |
hand_recwave "key 287 mod1" | |
hand_caprawmidi "key 289 mod1 mod2" | |
hand_scrshot "key 286 mod1" | |
hand_video "key 286 mod1 mod2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MOVED TO: https://github.com/meeuw/injectinput | |
#!/usr/bin/python3 | |
import evdev | |
import sys | |
upper = { '!': '1', '@': '2', '#': '3', '$': '4', '%': '5', '^': '6', '&': '7', '*': '8', '(': '9', ')': '0' } | |
with evdev.UInput() as ui: | |
escape = False |
temporenc v1:
100YYYYY YYYYYYYM MMMDDDDD
YYYYYYYY YYYYMMMM DDDDD111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import isclass | |
import __builtin__ | |
# We're going to overwrite object, so we need to squirrel away the old one: | |
obj = object | |
# Metaclass, overriding the class' __getattribute__, | |
# so that __qualname__ can be generated and cached on access: | |
class QualnameMeta(type): |
This script uses the great message extraction library gettext-extractor by lukasgeiter.
The script assumes that the location of the source files is ./src
. It parses both .js
and .vue
files. It writes the PO template file in ./i18n/messages.pot
.
Some things to note:
- It assumes that interpolations in the templates use the delimieters
{{}}
(it is the most commmon case). - It assumes that both the template and the script sections of the
.vue
single file components are defined inline, and not referenced by asrc
attribue (it is the most common case). - Expressions to extract are hardcoded. Currently they are
['$t', '[this].$t', 'i18n.t']
.
OlderNewer