Skip to content

Instantly share code, notes, and snippets.

View rek's full-sized avatar
🏋️

adam tombleson rek

🏋️
  • CNTXT
  • Riyadh, Saudi Arabia
View GitHub Profile
@rek
rek / setup.md
Last active January 4, 2023 05:42
Things to do after installing Ubuntu

Install:

$ sudo apt-get install aptitude git guake byobu python3-pip zsh htop curl

Manual install:

# 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/
#!/bin/bash
red(){
RED="\033[0;31m"
printf "${RED}${1}\n"
}
tmpFile="/tmp/frontend_test"
errorFrontend="/tmp/.error_tests_frontend"
rm -rf $tmpFile

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
rek / gist:f3ac813b498ce7523e6b
Last active August 27, 2019 10:30
GIT CHEATSHEET

==== Ohhh did you FORGETS yeS? ====

save passwords for 10 hours

git config --global credential.helper cache

git config credential.helper 'cache --timeout=36000'

BRANCHES (checkout https://github.com/rek/devconfig too now):

to see what branches exist and which one we are on

git branch -v

@rek
rek / terms
Created June 18, 2018 04:24
guake - open dev terms
#!/bin/bash
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
rek / retag.sh
Created November 15, 2016 06:08
Auto Git Re-Tag a branch
#!/bin/bash
echo ''
echo '--------------------------'
echo "--RE-TAGGING: ${1}"
echo '--------------------------'
echo ''
git tag -d ${1}
git push origin :refs/tags/${1}
@rek
rek / utils.js
Created August 17, 2016 14:32
PostgreSQL Insert Helper - Javascript
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)
@rek
rek / Postgres
Last active August 6, 2016 11:56
Start:
sudo su - postgres
psql
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
rek / gist:f18a7e38b8e4e3686584
Created September 4, 2014 06:26
Dust.js Cheatsheet
{?cond}
cond is true
{:else}
cond is not true
{/cond}
{^cond}
cond is false
{:else}
cond is not false