Skip to content

Instantly share code, notes, and snippets.

@MwirabuaTimothy
Last active December 27, 2015 20:18
Show Gist options
  • Save MwirabuaTimothy/7383173 to your computer and use it in GitHub Desktop.
Save MwirabuaTimothy/7383173 to your computer and use it in GitHub Desktop.
Starting up on Ubuntu

COMMANDS

replace [text in square blocks] with the right code snippets

ubuntu gain

speed, speed, speed
no viruses
open source juice
unix favors
become a guru swiftly

ubuntu loss

designing - adobe creative suite, paint.net, 
chrome canary
gui comfort - installing, configuring
ease to get sofware. almost any software has been made for windows, few for ubuntu

after installing ubuntu

Open a terminal (Ctrl + Alt + T)

sudo apt-get update
sudo apt-get upgrade

Download and install these:

sublime
chrome
sudo apt-get install vlc
audio plugins

configure

disk file permissions, automount
shortcuts
brightness control

more software to

lampserver
setup virtualhost
phpmyadmin
composer
curl, rvm, rubygems, rails
nodejs

artha
pinta
vuze
beyond compare
samba
indicators

install sublime text 3 package controll

https://sublime.wbond.net/installation

make it possible to install package controll

sudo chmod -R 777 "/home/techytimo/.config/sublime-text-3/"

ctrl+` [sublime console]

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

useful sublime packages

openfolder
gotofolder
sublimerge
ruby on rails snippets
js - angular, knockout, ember, nodejs
laravel - generator, snippets, blade highlighter, bootstrapper snippets
sftp
livereload
loremipsum
markdown

How to create soft link / symbolic lin

sudo ln -s {target-filename} {symbolic-filename}

Examples: sudo ln -s /media/[yourdisk] Downloads

sudo rm -r Downloads/ Music/ Pictures/ Documents/ Videos/
sudo ln -s /media/[yourdisk]/audio Music
sudo ln -s /media/[yourdisk]/pictures/ Pictures
sudo ln -s /media/[yourdisk]/projects/lab Documents
sudo ln -s /media/[yourdisk]/videos/ Videos

Caps lock and numlock indicators

sudo add-apt-repository ppa:tsbarnes/indicator-keylock
sudo apt-get update
sudo apt-get install indicator-keylock
setsid indicator-keylock to run it the first time

install google-tasks-indicator and google calendar-indicator

sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install google-tasks-indicator
sudo apt-get install calendar-indicator

Sticky Notes indicator

sudo add-apt-repository ppa:umang/indicator-stickynotes
sudo apt-get update
sudo apt-get install indicator-stickynotes

See all your devices

 mount -v | grep "^/" | awk '{print "\nPartition identifier: " $1  "\n Mountpoint: "  $3}'

filesystems

sudo subl /etc/fstab

static file system information.

http://askubuntu.com/questions/208318/how-to-chown-on-an-ntfs-or-fat32-partition

<file system> <mount point>   <type>  <options>       <dump>  <pass>
someWeirdId       /media/name  ntfs  auto,stuff,stuff,stuff,uid=1000,gid=1000,umask=0000  0  0

/dev/sda2           /media/sda2  ntfs  nls=iso8859-1,users,noauto,uid=1000,gid=1000,umask=000  0  0  
/dev/sda5           /media/sda5  ntfs  nls=iso8859-1,users,auto,uid=1000,gid=1000,umask=000  0  0  
/dev/sda1           /media/sda1  ntfs  nls=iso8859-1,users,noauto,uid=1000,gid=1000,umask=000 0  0  

How to automount filesystems on boot

http://askubuntu.com/questions/231880/pysdm-missing-in-ubuntu-12-10-and-higher

1. click to mount all how-do-i-add-and-remove-the-workspace-switcher-launcher-from-the-unity-launcheres you wanna automount
2. sudo subl /etc/mtab
3. copy the lines that represent those filesystems
4. sudo subl /etc/fstab
5. add these lines here and save

If brightness controls are not working

http://askubuntu.com/questions/21523/screen-brightness-not-changing-on-acer-5742-notebook

sudo subl /etc/default/grub.
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX="acpi_osi=Linux"
sudo update-grub

Set up php server

sudo apt-get install lamp-server^
sudo apt-get install phpmyadmin

Upgrade php version

http://www.dev-metal.com/how-to-setup-latest-version-of-php-5-5-on-ubuntu-12-04-lts/

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
sudo service apache2 restart

confirm:

php -v
whereis php
whereis php5

Setting up virtual host for Projects folder

https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/lab.conf

sudo subl /etc/apache2/sites-available/lab.conf

add:

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName lab

	DocumentRoot [your projects folder]
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory [your projects folder]>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		# Order allow,deny
		# allow from all
		Require all granted
	</Directory>

</VirtualHost>

solving http://lab/phpmyadmin not found error

http://developerguides.blogspot.com/2012/12/the-requested-url-phpmyadmin-was-not.html Open and edit your apache2.conf

sudo subl /etc/apache2/apache2.conf

Into the file write:

Include /etc/phpmyadmin/apache.conf

Mysql Login without a password:

sudo subl /etc/phpmyadmin/config.inc.php

Uncomment or add this line(if not there)

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

mysql exceed upload file size limit

http://stackoverflow.com/questions/3958615/import-file-size-limit-in-phpmyadmin

sudo subl /etc/php5/apache2/php.ini

Starting from bigger values the order should go like this

memory_limit
post_max_size
upload_max_filesize

Add virtualhost to map:

sudo subl /etc/hosts 

add under 127.0.0.1 localhost:

127.0.0.1	lab

Activate the host, with the built in apache shortcut:

sudo a2ensite lab

Restart apache

sudo /etc/init.d/apache2 restart

or:

sudo service apache2 restart

Browse http://lab and http://lab/phpmyadmin to confirm

Apache log files:

subl /var/log/apache2

Install curl:

sudo apt-get install curl

Get Composer | Global installation

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar composer
chmod a+x composer
sudo mv composer /usr/local/bin/composer

Get rvm and ruby

http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v and https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm

\curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles

rvm requirements # automatically install RVM dependancies
rvm use ruby --default # tell the system the ruby version to use
rvm rubygems current # makes sure that we have all the required components of Ruby on Rails
gem install rails # it is time to install Rails!

open this file to add rvm to the bash:

sudo subl ~/.bash_history

add this line in there and save:

source ~/.rvm/scripts/rvm

NodeJS latest version installation

https://www.digitalocean.com/community/articles/how-to-install-an-upstream-version-of-node-js-on-ubuntu-12-04

Start by changing the path to include commands from the ~/local/bin directory.

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

Follow up by sourcing the .bashrc file:

. ~/.bashrc

Create two new directories for the installation:

mkdir ~/local
mkdir ~/node-latest-install

Switch into the latest-install folder:

cd ~/node-latest-install

Run curl to get the node.js tarball and subsequently untar it.

curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1

Once that has completed, start the installation process, limiting it to the local user. Ensures that you will not need sudo later.

./configure --prefix=~/local

Run make install, but be warned: it does take a while.

make install

Finish up by downloading the the node package manager through curl:

curl https://npmjs.org/install.sh | sh

After you are all done, you can quickly check which version you have installed on your virtual private server.

node -v

Remove workspace switcher icon from launcher from 12.04

http://askubuntu.com/questions/38789/how-do-i-add-and-remove-the-workspace-switcher-launcher-from-the-unity-launcher

sudo subl /usr/share/unity-2d/shell/launcher/Launcher.qml

comment one line here

   Component.onCompleted: {
    items.appendModel(bfbModel);
    items.appendModel(applications);
/*  items.appendModel(workspaces);*/
    items.appendModel(devices);
    shelfItems.appendModel(trashes);
}

edit some system setting

sudo apt-get install gconf-editor
gconf-editor
org.gnome.settings-daemon.plugins.power

power button action suspend/hibernate/shutdown

gsettings set org.gnome.settings-daemon.plugins.power button-power 'suspend'

Check filetype mimetype:

file --mime-type -b [filename]

see all possible command

[double-tab!]

Documentation for any commands:

man [command]

installation details

whereis [package]

List process running in the background by name 'azureus'

ps -ef | grep azureus

exit the process by id shown in second column of the output

kill 3771

install beyond compare

http://www.scootersoftware.com/download.php http://forum.z27315.com/topic/14304-beyond-compare-337-build-15876-key/

nURCQNfYe7tyOXycDWmUJ1VFnSscg00JH9VDlPTsx134CbSlEqsmPOjirOJXYoImOf-ubkcF5E-vjWWUu3w8+dJzJXE6YVapYW7f+tRRXRFI4yn4NjjZ0RiiqGRCTVzwComUcXB-eiFWRBY6JpSsCNkmIxL5KsRCo442djHhTZE+

task managers

top
ps aux

instal fancy task manager

sudo apt-get install htop

See all installations made so far

awk '!/^Start|^Commandl|^End|^Upgrade:|^Error:/ { gsub( /\([^()]*\)/ ,"" );gsub(/ ,/," ");sub(/^Install:/,""); print}' /var/log/apt/history.log

all commands used so far

history

Open a folder from terminal

gnome-open . # current folder
gnome-open /folder/path

restart your ship

sudo shutdown -r now
@MwirabuaTimothy
Copy link
Author

You are welcome! I keep updating this file so you can actually help me with cool stuff you discovered!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment