Skip to content

Instantly share code, notes, and snippets.


adam tombleson rek

  • Oslo, Norway
View GitHub Profile
View lvm from live cd
# check the volumes
sudo pvs
# mount the right one
sudo mount /dev/mapper/mint--vg-root /mnt
sudo mount --bind /sys /mnt/sys/
sudo mount --bind /proc /mnt/proc/
sudo mount --bind /dev /mnt/dev/
sudo mount /dev/sda2 /mnt/boot
# confim
ls /mnt/boot/
rek /
Last active Apr 21, 2022
Things to do after installing Ubuntu
View Fail CI on errors or warnings
printf "${RED}${1}\n"
rm -rf $tmpFile
View Keyword

1: re-map capslock at key mapping level

// find a key code
xev | grep keycode
// re-map them
xmodmap -e "keycode 49 = asciitilde"
xmodmap -e "keycode 66 = grave"

// to save them:
// put the above keycode parts into a .modmap file, and add the .xsession from devconfig to load it each time
rek / terms
Created Jun 18, 2018
guake - open dev terms
View terms
guake -n guake -e 'cd dev/dragonlaw && c && v' guake -r 'Main'
guake -n guake -e 'cd dev/dragonlaw/src/scripts/modules/document && c && v' guake -r 'Document'
guake -n guake -e 'cd dev/dragonlaw/src/scripts/modules/doctype && c && v' guake -r 'Doctype'
guake -n guake -e 'cd dev/dragonlaw/src/scripts/baseApp && c && v' guake -r 'BaseApp'
guake -n guake -e 'cd dev/dragonlaw/src/scripts/submodules/entities && c && v' guake -r 'Entities'
guake -n guake -e 'cd dev/dragonlaw/src/scripts/submodules/components && c && v' guake -r 'Components'
exit 1
rek /
Created Nov 15, 2016
Auto Git Re-Tag a branch
echo ''
echo '--------------------------'
echo "--RE-TAGGING: ${1}"
echo '--------------------------'
echo ''
git tag -d ${1}
git push origin :refs/tags/${1}
rek / utils.js
Created Aug 17, 2016
PostgreSQL Insert Helper - Javascript
View utils.js
import _ from 'lodash'
let inserter = (table, items) => {
let validKeys = _.keys(items).join(', '),
countKeys = _.reduce(items, (results) => {
results.push('$' + (results.length + 1))
return results
}, []).join(', '),
data = _.values(items)
View Postgres
sudo su - postgres
By default, postgres tries to connect to a database with the same name as your user.
To prevent this default behaviour, just specify user and database:
psql -U Username DatabaseName
To check if running:
sudo service postgresql status
rek / Controller.js
Created Dec 24, 2015
Backbone model state system
View Controller.js
var view = new View({
state: state, // <- state
action: 'myFunction',
data: {
awesome: true
rek / Close function
Created Jul 15, 2015
Sublime Text - Snippits
View Close function
<description>Close callback function: });</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.javascript</scope> -->