Skip to content

Instantly share code, notes, and snippets.

View userAman16's full-sized avatar
🏔️
Madhyam Maarg

Aman userAman16

🏔️
Madhyam Maarg
View GitHub Profile
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active January 13, 2025 03:52
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 && \
@P-A-R-U-S
P-A-R-U-S / Golang-IP-to-CIDR
Created March 16, 2018 22:53
Go: Convert IP to CIDR
/ Convert IPv4 range into CIDR
func iPv4RangeToCIDRRange(ipStart string, ipEnd string) (cidrs []string, err error) {
cidr2mask := []uint32{
0x00000000, 0x80000000, 0xC0000000,
0xE0000000, 0xF0000000, 0xF8000000,
0xFC000000, 0xFE000000, 0xFF000000,
0xFF800000, 0xFFC00000, 0xFFE00000,
0xFFF00000, 0xFFF80000, 0xFFFC0000,
0xFFFE0000, 0xFFFF0000, 0xFFFF8000,
@P-A-R-U-S
P-A-R-U-S / Golang-CIDR-to-IP
Created March 16, 2018 22:55
Go: Convert CIDR to IP
// Convert CIDR to IPv4 range
func CIDRRangeToIPv4Range(cidrs []string) (ipStart string, ipEnd string, err error) {
var ip uint32 // ip address
var ipS uint32 // Start IP address range
var ipE uint32 // End IP address range
for _, CIDR := range cidrs {
@tuliocll
tuliocll / androidavd.desktop
Created January 13, 2020 17:22
Create shortcut for running android virtual device in linux (ubuntu, debian, arch, fedora...). Download this image and save on `~/Android/Sdk` folder with name `icon.png`. Change emulator name to yours. To see emulator name run this commando on terminal: `~/Android/Sdk/emulator/emulator -list-avds`
[Desktop Entry]
Version=1.0
Name=Android Virtual Device
Comment=Start Android virtual device
Exec=bash -c "~/Android/Sdk/emulator/emulator -avd Galaxy_Nexus_API_28"
Icon=~/Android/Sdk/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;