Skip to content

Instantly share code, notes, and snippets.

View jaderabbit's full-sized avatar
🎯
Focusing

Jade Abbott jaderabbit

🎯
Focusing
View GitHub Profile
@jaderabbit
jaderabbit / split_files_based_on_percentage.sh
Created October 18, 2018 16:49
split files based on %
split -l $[ $(wc -l filename|cut -d" " -f1) * percentage / 100 ] filename
@jaderabbit
jaderabbit / cool_terminal_tools.sh
Last active December 17, 2018 14:33
Cool Terminal Tools
split
wc
grep
sed
tee
@jaderabbit
jaderabbit / del_dups.sql
Created November 20, 2017 09:32
Deleting Dups Postgresql
DELETE FROM tablename
WHERE id IN (
SELECT id
FROM (SELECT id,
ROW_NUMBER() OVER (partition BY column1, column2, column3 ORDER BY id) AS rnum
FROM tablename) t
WHERE t.rnum > 1);
@jaderabbit
jaderabbit / How-to-install-Ubuntu-on-Dell-Inspiron-15-7000.md
Last active June 27, 2017 11:39
How to install Ubuntu on Dell Inspiron 15 7000
  1. You need Ubuntu 17 on a live usb. Ubuntu 16 does not appear to support the fancy CPUs

  2. You need to switch from IDE mode to AHCI mode on the harddrive else, it won't find it.

    1. Run Command Prompt as Admin
    2. Invoke a Safe Mode boot with the command: bcdedit /set {current} safeboot minimal
    3. Restart the PC and enter your BIOS during bootup.
    4. Change from IDE to AHCI mode then Save & Exit.
    5. Windows 10 will launch in Safe Mode.
    6. Right click the Window icon and select to run the Command Prompt in Admin mode from among the various options.
  3. Cancel Safe Mode booting with the command: bcdedit /deletevalue {current} safeboot

@jaderabbit
jaderabbit / server_wisdom
Last active June 20, 2017 10:32
Hein & Derik Server wisdom
sudo netstat -lpn
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
Something like
swapoff -a
fallocate 4G /swapfile
mkswap /swapfile
swapon /swapfile
@jaderabbit
jaderabbit / server_wisdom
Created June 14, 2017 09:25
Hein & Derik Server wisdom
sudo netstat -lpn
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
Something like
swapoff -a
fallocate 4G /swapfile
mkswap /swapfile
swapon /swapfile
@jaderabbit
jaderabbit / spark_setup.bat
Created February 6, 2017 13:29
Environment Variables for Spark
JAVA_HOME=...
SPARK_HOME=...
SPARK_SCALA_VERSION=...
@jaderabbit
jaderabbit / things-derik-says-2
Created October 20, 2016 10:39
things derik says - import export csv from db for numpy
psql -e \copy (select * from py_killer) to /tmp/eat_me_numpy.csv
@jaderabbit
jaderabbit / things-derik-says.sh
Created October 13, 2016 07:50
things derik says - how to restore a pg database
pg_restore -v -U dev -W -d kalories_galore -n public -O ./muffin.dmp
@jaderabbit
jaderabbit / find-replace-exclude-git
Created June 8, 2016 14:42
find-replace-exclude-git
grep -lr --exclude-dir=".git" -e "oldword" . | xargs sed -i "s/oldword/newword/g"