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
@pklaus
pklaus / ping.py
Created March 5, 2011 09:50
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@leighmacdonald
leighmacdonald / regions.csv
Created June 8, 2012 03:04
Region Mappings
AD 02 Canillo
AD 03 Encamp
AD 04 La Massana
AD 05 Ordino
AD 06 Sant Julia de Loria
AD 07 Andorra la Vella
AD 08 Escaldes-Engordany
AE 01 Abu Dhabi
AE 02 Ajman
AE 03 Dubai
@zhaostu
zhaostu / remove_residual_config.sh
Created October 21, 2012 19:16
One-liner to remov all residual config packages in Ubuntu
# Remove all the packages with residual configuration.
# http://stuzhao.blogspot.com/2012/07/removing-all-residual-config-packages.html
sudo apt-get remove --purge `dpkg -l | grep '^rc' | awk '{print $2}'`
@obfusk
obfusk / authorized_keys
Last active November 20, 2021 17:25
ssh restricted commands
command="./ssh-cmd.bash",no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding ssh-rsa ...KEY... user@host
#!/bin/awk
#before processing lines, check if "src" variable has been passed
#If so, print it out, if not just print "origin"
#Set the field separator to be '(' or ')'
BEGIN {
if (src) {
printf "%s -> ", src
} else {
printf "%s -> ", "origin"
}
@natelandau
natelandau / .bash_profile
Last active September 20, 2025 16:13
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@marcosptf
marcosptf / iptables
Created October 6, 2014 21:30
comandos IPTABLES
sudo iptables -t nat -L -n -v
sudo iptables -t filter -F
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -t nat -L -n -v
sudo iptables -t nat -A PREROUTING -i eth1 --src 10.3.14.118 --dst 127.0.0.1 -p tcp --dport 1198 -j REDIRECT --to-ports 5000
sudo iptables-save
sudo iptables -t nat -L -n -v
/*descobrir portas abertas */
@brianmed
brianmed / update.txt
Created November 7, 2014 09:09
Auto update timestamp in postgres
[bpm@dev000] c:/opt>cat sql
BEGIN;
CREATE OR REPLACE FUNCTION update_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated = now();
RETURN NEW;
END;
$$ language 'plpgsql';
COMMIT;
@vszakats
vszakats / s3-upload-aws4.sh
Last active April 29, 2025 07:26
AWS S3 upload using signature v4
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,