Skip to content

Instantly share code, notes, and snippets.

View lpf23's full-sized avatar

Lee Foster lpf23

  • Texas
View GitHub Profile
@lpf23
lpf23 / CanonMG5200_Ubuntu
Created July 2, 2014 22:56
Canon MG5200 & Ubuntu
sudo add-apt-repository ppa:michael-gruz/canon-trunk
sudo apt-get update
sudo apt-get install cnijfilter-common
sudo apt-get install cnijfilter-mg5200series
@lpf23
lpf23 / Useful Linux Commands
Last active August 29, 2015 14:02
Useful Linux Commands
File & Directory chmod value:
1) stat --format '%a' <file/directory>
2) stat -c %a <file/directory>
File & Directory Sizes:
du -sh *
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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