Skip to content

Instantly share code, notes, and snippets.

@ps
ps / gist:6766407
Last active December 24, 2015 07:49
Ubuntu 12.10 Fixes
Fix 1
---------------------------------------------------
From time to time I'll get a clicking sound from my hard drive, I have identified it to be HDD head parking problem. The fix that has worked for me was the following:
Temporary solution: sudo hdparm -B 255 /dev/sda
sudo vim /etc/hdparm.conf
Unfortunately after sleep or reboot the heads parking property resets back to default. I don't want to run this command every time so I came upon a fix in ArchLinux which put a bash script in a folder that executes everything in it on awake/power on.
In Ubuntu 12.10 I placed my script in /etc/pm/power.d and /etc/pm/sleep.d
@ps
ps / gist:7664902
Created November 26, 2013 19:46
Changing where localhost points to in Ubuntu 12.10
-Navigate to /etc/apache2/sites-enabled
-sudo vim into the default file (000-default)
-Change DocumentRoot and second <Directory> path to the path where you want localhost to point to
-sudo service apache2 restart
-DONE!
@ps
ps / gist:9454764
Last active September 10, 2022 11:32
Ubuntu 12.10/12.04 Realtek rtl8188ce Wireless Adapter Issues
Recently my dorm wireless network has been working fine on all devices except my Ubuntu 12.10 laptop.
So I did some research and some simple fixes that have seemed to work for now are:
-change router security to WPA2 only
-change router channel from automatic to either 1 or 11
-if router is b/g/n, attempt to change to b/g (was not able to do this with my router)
-sudo vim /etc/modprobe.d/rtl8192ce.conf and insert the following line:
'options rtl8192ce ips=0 fwlps=0 swenc=1 debug=2'
Switched to Ubuntu 12.04 and entered the following to see if wireless works better:
@ps
ps / gist:9671636
Created March 20, 2014 19:16
Firefox userChrome.css
This is the setting placed in ~/.mozilla/firefox/<default-user-profile>/chrome/userChrome.css:
/*******
START
********/
/*Do not remove the @namespace line -- it's required for correct functioning*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/*Toolbar & menu font size*/
@ps
ps / gist:9755379
Created March 25, 2014 04:41
Going back to a previous kernel of Ubuntu
Fire up the terminal and run this command:
dpkg -l | awk '/linux-[^ ]+-[0-9]/ {print $2}'
It should print all of the available kernel versions.
Check which version of kernel you are currently running by typing in: uname -a
Once you know which new version of the kernel you want to remove type:
sudo apt-get purge linux-headers-3.8......
@ps
ps / gist:9798701
Last active August 29, 2015 13:57
Installing Apache2 and PHP on Ubuntu 12.04
The only simple command you need is:
sudo apt-get install apache2
Navigate to: http://localhost and you shall see the magical 'It works!' file!
Now to get PHP working:
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
@ps
ps / gist:9799328
Last active August 29, 2015 13:57
Installing MySQL and phpMyAdmin
First we need to install MySQL with the following:
sudo apt-get install mysql-server
Note: You will be prompted for the root password in the middle of the installation.
Now this is optional (for uses with MySQL workbench):
sudo apt-get install mysql-client
Now to test it out try: mysql -uroot -p
@ps
ps / gist:10908532
Last active August 29, 2015 13:59
Mounting Remove Drives with SSHFS
So there are times when you need to connect to a remote server and do some sort of work on the files.
One alternative is to use an FTP client such as FileZilla and constantly upload to view changes.
Scratch that, just use SSHFS! It mounts the remote drive/directory on your local machine and you can
work/save files and the changes will be automatically uploaded.
First install sshfs, on Ubuntu: sudo apt-get install sshfs
In order to mount a drive use your usual ssh account and specify a directory on which you would like the mount
to occur like so:
@ps
ps / gist:76318790771e2ae5b7fb
Created October 6, 2014 16:10
Unnecessary double title bar on Ubuntu
To get rid of them run:
gconftool-2 -s -t string '/apps/compiz-1/plugins/decor/screen0/options/decoration_match' '!(state=maxvert & state=maxhorz)'
@ps
ps / gist:4a17de017ccf350f4c67
Created November 1, 2014 23:51
Dealing with existing SSH keys
I already had git ssh keys set up and now wanted to use the same one for logging into my Digital Ocean droplet. To copy over ssh keys to the remote droplet just do:
ssh-copy-id user@address