Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View uoryon's full-sized avatar

sū hǎi uoryon

View GitHub Profile
@uoryon
uoryon / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created January 17, 2017 05:58 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@uoryon
uoryon / ipToInt.js
Last active September 2, 2015 01:49
var ipToInt = function ipToInt(ip) {
var int = 0, i = 0;
ip = ip.split('.');
while (i <= 3) {
int += ip[i] * Math.pow(256, 3 - i);
i++;
}
return int;
}