Skip to content

Instantly share code, notes, and snippets.

View lpf23's full-sized avatar

Lee Foster lpf23

  • Texas
View GitHub Profile
@lpf23
lpf23 / OS X - Show Hidden Files
Last active August 29, 2015 13:57
OS X - Show Hidden Files
Show all files:
$ defaults write com.apple.finder AppleShowAllFiles -boolean true
$ killall Finder
Hide the hidden files again:
$ defaults delete com.apple.finder AppleShowAllFiles
$ killall Finder
@lpf23
lpf23 / Install VirtualBox Guest Additions with Debian VM
Created April 19, 2014 23:36
Install VirtualBox Guest Additions with Debian VM
http://virtualboxes.org/doc/installing-guest-additions-on-debian/
Follow these steps to install the Guest Additions on your Debian virtual machine:
1) Login as root;
2) Update your APT database with apt-get update;
3) Install the latest security updates with apt-get upgrade;
4) Install required packages with apt-get install build-essential module-assistant;
5) Configure your system for building kernel modules by running m-a prepare;
6) Click on Install Guest Additions… from the Devices menu, then run mount /media/cdrom.
@lpf23
lpf23 / CentOS & sudo
Created April 29, 2014 21:41
CentOS & sudo
http://wiki.centos.org/TipsAndTricks/BecomingRoot
-- su --
su - <user> --> gives identity of <user> along with <user>'s environment
su <user> --> gives identity of <user> only
su - root --> gives identify ot root along with environment
su root --> gives identity of root only
su - --> gives identity of root along with environment
@lpf23
lpf23 / CentOS Static IP
Created May 3, 2014 16:31
Set Static IP in CentOS VM
# vi /etc/sysconfig/netwokr-scripts/ifcfg-eth0
DEVICE=eth0
...
BOOTPROTO=static
IPADDR=192.168.1.123
NETMASK=255.255.255.0
...
@lpf23
lpf23 / Install postgresql on CentOS - configure to connect with pgAdmin
Last active August 29, 2015 14:00
Installing postgres on CentOS - pg_hba.conf modifications
1) # yum install postgresql postgresql-server
2) # chkconfig postgresql on
3) # service postgresql start
4) # sudo -s
5) # su - postgres
6) $ psql -d template1 -U postgres
7) ALTER USER postgres WITH PASSWORD '<newpassword>';
8) \q
9) # cd /var/lib/psql/data
10) # vi pg_hba.conf
@lpf23
lpf23 / Update VBoxGuestAddtions on CentOS Guest
Created May 9, 2014 15:54
Update VirtualBox Guest Additions on CentOS
I ran into an issue updating VirtualBox Guest Additions on CentOS 6.5 guest.
This error specifically:
"Virtualbox Guest Additions installation, Windows System and desktop setup install_x11_startup_app: no script"
To resolve this error:
1) Remove any old VBoxGuestAdditions-x.x.xx directories in /opt/
ex: # rm -rf /opt/VBoxGuestAdditions-4.3.08
2) Remove symlinks /usr/lib64/VBoxGuestAdditions and /usr/share/VBoxGuestAdditions
@lpf23
lpf23 / jekyll theme npm commands
Created May 16, 2014 18:02
Update Jekyll Theme Using NPM & Grunt
$ cd /workspace/TECBlog <---- location of package.json file
$ npm install <---- install packages referenced in package.json (only need to run once)
$ grunt <---- run commands (theme changes, optimizations, etc.) in Gruntfile.js
@lpf23
lpf23 / SHA1 JavaScript Demo
Created May 21, 2014 19:26
Demo HTML page that runs a string through SHA1
<html>
<script type="text/javascript">
/**
* Secure Hash Algorithm (SHA1)
* http://www.webtoolkit.info/
**/
function SHA1(msg) {
function rotate_left(n,s) {
var t4 = ( n<<s ) | (n>>>(32-s));
return t4;
@lpf23
lpf23 / Heroku DB Backup Commands
Last active August 29, 2015 14:01
Heroku DB Commands
heroku pgbackups:capture DATABASE --app app1 --expire
@lpf23
lpf23 / Install VirtualBox Guest Additions on Centos 6.5
Created June 11, 2014 19:45
Install VirtualBox Guest Additions on Centos 6.5
1. In order to fully update your guest system, open a terminal and run
yum update
as root.
2. Install the GNU C compiler and the kernel development packages using
yum install gcc