Skip to content

Instantly share code, notes, and snippets.

@tuanle
tuanle / ubuntu_install_lamp.sh
Last active August 29, 2015 13:57
Setup lamp stack on ubuntu
#==============================================
# Update & upgrade system
#==============================================
sudo apt-get update
sudo apt-get upgrade
#==============================================
# Install apache2
#==============================================
@tuanle
tuanle / ubuntu_first_setup.sh
Created April 1, 2014 15:28
Setup for the first time after install ubuntu.
#==============================================
# Install core for developer, I swear
#==============================================
sudo apt-get install curl git-core vim
#==============================================
# Install extras
#==============================================
@tuanle
tuanle / brightness.sh
Created April 1, 2014 15:38
Fix problem that ubuntu (or maybe based ubuntu distro) always reset screen brightness setting on laptop. It is tested in mine Thinkpad T530.
sudo bash -c '{
echo "start on (login-session-start)"
echo "script"
echo " echo 13 2>/dev/null > /sys/class/backlight/acpi_video0/brightness"
echo " echo 13 2>/dev/null > /sys/class/backlight/acpi_video1/brightness"
echo "end script"
} > /etc/init/brightness.conf '
# Another way, you can insall xbacklight
@tuanle
tuanle / gnome-terminal-zenburn.sh
Created April 1, 2014 15:41
Zenburn color scheme for gnome-terminal. I very like it.
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
@tuanle
tuanle / .bash_aliases
Last active August 29, 2015 14:00
My basic ubuntu setup and dot files.
# SYSTEM
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias www='cd /var/www/html/'
# EDITOR
alias v=vim
alias sv='sudo vim'
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
apt-get clean
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/partial/*
apt-get clean
apt-get update
apt-get upgrade
class MyClass {
// add one member var that holds all the data
private $myMagicData = array();
private $another_var;
function __construct($data){
$this->example = $data; // this will auto-call the __set function
$this->another_var = $data; // this won't, since $this->another_var was declared above
}
@tuanle
tuanle / fix_hidden_files.txt
Created September 30, 2015 03:09
Fix show hidden files by default in ubuntu
open terminal and type:
dconf-editor
Enter and then:
org->gtk->settings->file-chooser
uncheck show-hidden
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install freshplayerplugin
This will install pepper flash(google chrome's flash player) to firefox.