Quick Reference Page

This is a page for me to put things I want to quickly and easily reference.
Hosts file (Windows) location  C:\Windows\System32\drivers\etc\hosts
NB : Run as System Administrator

PAL SD : 720×576 25i
Canon 7d : 1920×1080 25p

 

When starting a new Orion VM server

New OrionVM server
First steps :

0. Use the OrionVM panel https://panel.orionvm.com.au/ to run the instance’s console.
1. Login as root (no password)
2. Run ‘passwd’ and type a new password in and repeat it.
4. Use SSH to login as root
5. Run ssh-keygen to setup Key pairs
6. Add the authorized_keys file
7. Create a user account (adduser) and disable the root password
8. apt-get update
7. apt-get install nano
8. nano /etc/hostname (e.g from ubuntu to main.servers.teachertime.com.au )
9. hostname -F /etc/hostname
10. Update Timezone using dpkg-reconfigure tzdata
11. bash (to see if the hostname and time zone environmental vars updated)
12. _installNewWebServer or apt-get install the list of apps after the alias’s…. Will be asked for MySQL root password
13. vnstat -u -i eth0 # Create the vnstat networking database
14. a2enmod deflate expires rewrite dav
15 dpkg-reconfigure exim4-config
16. Create the log file folders for apache ( e.g mkdir /var/log/apache2/filmsonthefly )
17. rsync -azvh –progress -e ssh <username>@<servername>.servers.filmsonthefly.com:/<username>/.cron /<username>/.cron # Copy the cron and maybe the scripts folder from the previous server
17. crontab -l && crontab -e # Install the MySQL database backup script and various other things 

Some Alias’s

alias aRestart=’apache2ctl -k graceful’
alias acs=’apt-cache search’
alias agg=’sudo apt-get upgrade’
alias agi=’sudo apt-get install’
alias agr=’sudo apt-get remove’
alias agu=’sudo apt-get update’
alias aliasd=’nano ~/.bash_aliases’
alias alogs=’sudo tail -f /var/log/apache2/access_logs/*_log /var/log/apache2/error_logs/*_log’
alias aps=’sudo dpkg –get-selections’
alias apt=’sudo apt-get install’
alias bashrc=’nano ~/.bashrc’
alias cdetca=’cd /etc/apache2/sites-available’
alias cdwww=’cd /var/www/’
alias chownWWW=’sudo chown -Rc www-data:www-data * .ht*’
alias da=’du -hsc *’
alias das=’du -cks * 2>/dev/null | sort -rn | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e “${size}${unit}\t${fname}”; break; fi; size=$((size/1024)); done; done;’
alias dir=’ls –color=auto –format=vertical’
alias directoryExec=’sudo find * -type d -exec chmod -c ug+x {} \;’
alias directoryRWX=’find * -type d -exec chmod -c ug+rwx {} \;’
alias ds=’du -hsc * | sort -n’
alias egrep=’egrep –color=auto’
alias eximQ=’sudo exim -bp’
alias eximRouting=’exim -bt’
alias fgrep=’fgrep –color=auto’
alias grep=’grep –color=auto’
alias l=’ls -CF’
alias la=’ls -A –color=auto’
alias ldir=’ls -l | egrep ‘\”^d’\”’
alias lf=’ls -l | egrep -v ‘\”^d’\”’
alias ll=’ls -Alsch –color=auto’
alias load=’uptime’
alias logs=’find /var/log/ -name “*.log” -type f -exec tail -n 1 -f {} +’
alias logsErrors=’find /var/log/ -name “error.log” -type f -exec tail -f {} +’
alias logsudo=’sudo find /var/log/ -name “*.log” -type f -exec sudo tail -f {} +’
alias ls=’ls –color=auto’
alias maillog=’tail -n 50 -f /var/log/exim4/mainlog /var/log/exim4/rejectlog’
alias mailstats=’eximstats /var/log/exim4/mainlog’
alias mem=’free -m’
alias netstats=’sudo netstat -tulpn’
alias openz=’gzip -d -c’
alias rm=’rm -v’
alias rma=’rm -Rv’
alias screenDetach=’echo Press [ctrl]+ a, d to detach. Screen -list to view and screen -r to reattach’
alias timezone_new=’dpkg-reconfigure tzdata’
alias ubuntuVersion=’cat /etc/lsb-release’
alias vdir=’ls –color=auto –format=long’

CLI in colour

1. edit the ~/bashrc file and uncomment ‘force_color_prompt=yes
2.Set the PS1 string after the line ‘if [ “$color_prompt” = yes ]; then’ to : 

PS1=’\[\e[1;34m\][\@]\[\e[01;32m\]\u@\h\[\e[00m\]:\[\e[1;36m\]\w\[\e[00m\]$ ‘

 

Applications to install (works on Ubuntu/Debian style only):

alias _installNewWebServer=’apt-get update; time apt-get install man apache2 apache2-doc apache2-suexec php5 php5-cli php5-curl php5-gd php5-mysql php5-mcrypt php-pear mcrypt php5-suhosin libgd-tools exim4 exim4-daemon-light exim4-doc-html exim4-doc-info mailutils rsync subversion subversion-tools mysql-client mysql-common mysql-server build-essential wget dnsutils webalizer awstats screen fail2ban ncdu nmap vnstat htop iftop unzip
alias _installExtraApps=’apt-get install linklint httrack lsof