Skip to content

Instantly share code, notes, and snippets.

View andyafter's full-sized avatar

Pan An andyafter

  • NUS -> Grab
  • Singapore
View GitHub Profile
@andyafter
andyafter / Duplication Removal
Created March 4, 2019 06:54
Remove Duplications in PATH
TMP_PATH=echo $PATH | tr ':' '\n' |sort -u |tr '\n' ':'
@andyafter
andyafter / bash-prompt-name.md
Created April 20, 2016 07:42
Change your bash prompt to only current folder name instead of full path

export PS1='${debian_chroot:+($debian_chroot)}[\033[01;31m]\u@\h[\033[00m]:[\033[01;36m]\W[\033[00m]$ '

@andyafter
andyafter / compile-gcc-assembly.md
Created April 16, 2016 18:24
Compile and Run gcc generated assembly code.

Yes, You can use gcc to compile your asm code. Use -c for compilation like this:

gcc -c file.s -o file.o

This will give object code file named file.o. To invoke linker perform following after above command:

gcc file.o -o file

@andyafter
andyafter / org-error-wrong-num-arg.md
Last active April 14, 2016 14:21
org-export-as: Wrong number of arguments

Simply wrap this around your org-mode configurations:

(with-eval-after-load 'org
 ;;; someyoru configurations here:
 )

Why? Because:

@andyafter
andyafter / hardinfo.md
Created April 12, 2016 05:16
Getting hardware info under linux(Ubuntu, specifically)

lspci will show you most of your hardware in a nice quick way. It has varying levels of verbosity so you can get more information out of it with -v and -vv flags if you want it. The -k argument is a good way to find out which kernel driver a piece of hardware is using. -nn will let you simply know the hardware ID which is great for searching.

It doesn't show USB hardware other than the USB busses.

Graphics:

  • lspci -nnk | grep VGA -A1