Skip to content

Instantly share code, notes, and snippets.

View ekiara's full-sized avatar
🎯
Focusing

Eric Kiara ekiara

🎯
Focusing
View GitHub Profile
@ekiara
ekiara / snippets-bash.rst
Last active November 3, 2021 06:29
snippets-bash.rst

Bash Snippets

Get the first and last line from stdout input

https://unix.stackexchange.com/questions/139089/how-to-read-first-and-last-line-from-cat-output
@ekiara
ekiara / removing_ppas_in_ubuntu.bash
Created August 24, 2013 11:20
Removing PPAs in Ubuntu
# Removing PPAs in Ubuntu
sudo apt-add-repository --remove ppa:iaz/battery-status
@ekiara
ekiara / update_vmware_kernel_modules_after_upgrading_your_linux_kernel.bash
Last active October 24, 2020 17:22
Update VMware kernel modules after upgrading your Linux kernel
# Update VMware kernel modules after upgrading your Linux kernel
# Depending on your current kernel version, linux-headers-3.8.0-29-generic might be something else (i.e. 3.8.0-31)
#
# References:
# http://mergy.org/2013/03/three-tips-to-get-vmware-workstation-9-going-on-kernel-3-8-0/
# http://askubuntu.com/questions/288373/vmplayer-problem-vmware-kernel-module-updater-doesnt-run-since-13-04-upgrade
#
sudo ln -s /usr/src/linux-headers-3.8.0-29-generic/include/generated/uapi/linux/version.h /usr/src/linux-headers-3.8.0-29-generic/include/linux/version.h
sudo /usr/bin/vmware-modconfig --console --install-all
@ekiara
ekiara / getting_the_last_n_characters_of_a_string.bash
Created September 1, 2013 10:55
Getting the last 'n' characters of a string
#!/bin/bash
#
# Getting the last 'n' characters of a string
# i.e. for getting the last 16 characters of all files (useful when dealing
# with Youtube downloads)
ls | awk '{print substr($0, length($0) - 15, length($0))}'
@ekiara
ekiara / recursively_adding_write_permissions_for_the_group.bash
Created September 5, 2013 10:05
Recursively adding write permissions for the group
#!/bin/bash
# Recursively adding write permissions for the group
chmod -R ug+rw ./directory/
# <OR>
chmod --recursive ug+rw ./directory/
@ekiara
ekiara / how-do-you-view-quora-links-without-logging-in-p.txt
Created September 10, 2013 08:53
How do you view quora links without logging in?
@ekiara
ekiara / ftp_cheatsheet.txt
Created September 11, 2013 23:25
FTP cheatsheet
# Non-interactive MPUT (i.e. doing MPUT without getting prompted for a Y/N for each file)
ftp -i the.server.you.are.connecting.to.com
MPUT /path/to/files/*
<or>
# write, writing, towrite
Write about how to do multiline SMS with chan_dongle and SendDongleSMS()
ssh-keygen (rsa vs dsa)???? Does it make any difference????
Compare difflib to pylevenshtein to hashlib for simple text similarity analysis (i.e. how similar is Kihara to Kiara?)
- pylevenshtein (code.google.com/p/pylevenshtein/‎)
- hashlib
- difflib
chromeext: See just one css rule for a particular element at a time (i.e. background-image)
chromeext: Get all links on a page, automatically put in clipboard
desktop-app: copy/clipboard history
@ekiara
ekiara / wget_snippet
Created September 14, 2013 10:46
wget_snippet
wget -E -H -k -K -p http://example.com/site/page-you-want-to-mirror.html