Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, November 13, 2011

Quick start on latex beamer [Ubuntu]

Beamer is a Tex class to make slide presentations. The advantages of Beamer over PowerPoint or OpenOffice:
  • If you are creating slides from a larger document, you can simply re-use your LaTeX source material from that document.
  • If you need mathematical content in your slides, you have the wealth of mathematical constructs in LaTeX to draw upon.
  • The slides you create are multi-platform.
Installation on Ubuntu
$ sudo apt-get install latex-beamer

Create your own slides from a template
A good template can be found here. Note: compile it by PdfLatex, or press F6 in TexMaker.

Monday, September 19, 2011

Texmaker setup on Ubuntu 10.04

  1. Install Tex Live packages:
    $ sudo apt-get install texlive-latex-base
    
  2. Install a GUI, like Texmaker:
    $ sudo apt-get install texmaker
    

How to set vim tab width on Ubuntu

Create/modify the $HOME/.vimrc by adding the following lines to set the width of the tab to be 4.
set expandtab
set shiftwidth=4
set softtabstop=4
Explanation:
  • expandtab: affects what happens when you press the <TAB> key.
  • shiftwidth: affects what happens when you press >>, << or ==.
  • softtabstop: affects what happens when you press the <TAB> keys if expandtab is set.

Tuesday, September 6, 2011

Spoof mac address on ubuntu 10.04(Ubuntu修改MAC地址)

Open a terminal (ctrl+alt+t) and type in the following commands:
$ sudo ifconfig wlan0 down hw ether XX:XX:XX:XX:XX:XX
$ sudo ifconfig wlan0 up
Then type in the following command to verify the change:
$ ifconfig
Note1:Replace XX:XX:XX:XX:XX:XX with the Mac Address you want. And in this case "wlan0" is my wireless adapter name and it should be replaced with your own adapter name, e.g., eth0 for Ethernet connection. To get the list of adapter names, use ifconfig command.
Note2:This only spoof the mac address temporarily, but you can make it to be shell script running every time system reboot.

Monday, August 22, 2011

Ubuntu Tricks

Create a shortcut with customized icon in Ubuntu
Right click -> Create a launcher
Type in the command, e.g.,
/home/owen/Programs/FRD/./frd.sh
Click on the left-top figure to change the icon
Unzip rar file
$ sudo apt-get install unrar
Grant a user root privilege
To enable a user run a sudo command without password, just run:
$ sudo visudo
Then add the following line after "root ALL=(ALL) ALL" like this:
username ALL=(ALL) ALL
After a logout or reboot, it will take effect.
Run a script at the system startup
Put the script example.sh into /etc/init.d/ and change its mode to executable by:
$ sudo chmod +x example.sh
Then update the rc by:
$ sudo update-rc.d example.sh defaults 80
Note: since example.sh is a shell script, it should start with: #! /bin/sh.
To remove this script from startup:
$ sudo update-rc.d example.sh remove
Set environment variable
Set a temporary environment variable:
$ export PATH=$PATH:another_path
Set a permanent environment variable for your own:
$ cd~
$ echo "export PATH=$PATH:another_path" >> .bashrc
Set a permanent environment variable for system-wide:
$ cd /etc
$ echo "export PATH=$PATH:another_path" >> bash.bashrc