Skip to content

Instantly share code, notes, and snippets.

View mskf3000's full-sized avatar
💭
I may be slow to respond.

MSKF3000 mskf3000

💭
I may be slow to respond.
View GitHub Profile
@mskf3000
mskf3000 / tr4_ll.c
Created February 6, 2020 19:58 — forked from fffaraz/tr4_ll.c
TCP/ICMP/UDP traceroute
/* Copyright (C) 2012-2015 P.D. Buchan ([email protected])
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@mskf3000
mskf3000 / tracerout.py
Created February 6, 2020 20:15 — forked from en0/tracerout.py
My traceroute program in python using scapy.
#!/bin/usr/env python2
from scapy.all import *
from argparse import ArgumentParser
from sys import argv
from time import time
# shut up scapy
conf.verb=0
asn() {
if [ -z "$1" ]
then
echo "usage: asn url" 1>&2
return 1
fi
ips=$(dig $DIG_ARGS +short $1)
if [ -z "$ips" ]
then
@mskf3000
mskf3000 / asn
Created February 17, 2020 01:40 — forked from nitefood/README.md
ASN/IP/Route/hostname command line lookup tool to map any network to the corresponding ASN and prefix
#!/bin/bash
############################################################################################################
# ----------------------------------------------------------------------
# ASN/IPv4/Prefix lookup tool. Uses Team Cymru's whois service for data.
# ----------------------------------------------------------------------
# example usage:
# asn <ASnumber> -- to lookup matching ASN data. Supports "as123" and "123" formats (case insensitive)
# asn <IP.AD.DR.ESS> -- to lookup matching route and ASN data
# asn <ROUTE> -- to lookup matching ASN data
@mskf3000
mskf3000 / ubuntu-kernel-tuning.sh
Created March 6, 2020 04:11 — forked from soediro/ubuntu-kernel-tuning.sh
ubuntu kernel tuning script
#!/bin/bash
#vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
#
# Author : Nicolas Brousse <[email protected]>
# From : https://www.shell-tips.com/2010/09/13/linux-sysctl-configuration-and-tuning-script/
#
# Added kernel version < 2.6.33 set net.ipv4.tcp_congestion_control=htcp
# Notes :
# This script is a simple "helper" to configure your sysctl.conf on linux
# There is no silver bullet. Don't expect the perfect setup, review comments
@mskf3000
mskf3000 / cloud-netblocks.sh
Created March 23, 2020 17:33
Onde posso encontrar os intervalos de IP do Compute Engine?
seq 10 | xargs -l -I{} dig +short -t TXT @ns1.google.com _cloud-netblocks{}.googleusercontent.com | tr ' ' '\n' | grep -F ip4 | cut -d ':' -f 2 | sort -V > cloud-netblocks.cidr
@mskf3000
mskf3000 / gcloud_ssh_complete
Created March 27, 2020 21:42 — forked from miquelbar/gcloud_ssh_complete
Gcloud ssh autocomplete
#!/bin/bash
export _SSH_COMPLETE_F_CACHE="/tmp/_ssh_complete"
export _SSH_COMPLETE_HOSTS=""
[[ ! -f "$_SSH_COMPLETE_F_CACHE" ]] && touch "$_SSH_COMPLETE_F_CACHE"
_ssh_complete() {
if [ -z "$_SSH_COMPLETE_HOSTS" ]; then
@mskf3000
mskf3000 / create_instance.sh
Created March 27, 2020 21:51 — forked from Amey-D/create_instance.sh
Script to create a GPU-enabled COS instance on GCE and to install Nvidia GPU driver in a container.
#!/bin/bash
set -o nounset
set -o errexit
set -o pipefail
set -x
INSTANCE_NAME=$1
shift
@mskf3000
mskf3000 / doctl
Created March 29, 2020 17:39 — forked from android10/doctl
Digital Ocean Command Line Interface
DOCTL
Installation
Option 1 – Download a Release from GitHub
Visit the Releases page for the doctl GitHub project.
https://github.com/digitalocean/doctl/releases
tar xf ~/doctl-1.4.0-linux-amd64.tar.gz
sudo mv ~/doctl /usr/local/bin
Configure