Skip to content

Instantly share code, notes, and snippets.

View robotamer's full-sized avatar

TaMeR robotamer

View GitHub Profile
@bhelm
bhelm / arch-chroot.sh
Created April 16, 2020 09:46
Chroot script from Archlinux (arch-chroot), works on any distri
#!/bin/bash
shopt -s extglob
# generated from util-linux source: libmount/src/utils.c
declare -A pseudofs_types=([anon_inodefs]=1
[autofs]=1
[bdev]=1
[bpf]=1
[binfmt_misc]=1
@erlepereira
erlepereira / DNSMasq_withMalwareBlocking.md
Last active February 22, 2024 07:00
Using DNSMasq as a caching nameserver & add in a malware etc blocking

Assuming a Properly configured DNSMasq

a quickstart for dnsmasq is given at the end if you have not set it up yet.

something like this will add a great regularly updated malware file for it to use. More security and privacy to you! Specifically, this uses https://github.com/StevenBlack/hosts Choose one of the Raw Hosts file from there to use.

To setup DNSMasq, follow the below ...

wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/malware.conf`
@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 2, 2024 13:30
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@ryo1kato
ryo1kato / perror
Created April 3, 2012 12:37
perror - bash implementation
#!/bin/bash
errno_headers="/usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h"
print_usage () {
echo "Usage: ${0##*/} ERRNO"
}
case $1 in
@robotamer
robotamer / rstrstr.php
Created April 21, 2011 08:39
php rstrstr
<?php
/**
* @author : Dennis T Kaplan
*
* @version : 1.0
* Date : June 17, 2007
* Function : reverse strstr()
* Purpose : Returns part of haystack string from start to the first occurrence of needle
* $haystack = 'this/that/whatever';
* $result = rstrstr($haystack, '/')
@jacius
jacius / untar
Created October 5, 2009 20:34
untar: A simple shell script to untar a tarball.
#!/bin/bash
#
# A simple command to untar any tarball.
#
# For times when you don't care whether it was compressed
# with bzip2 or gzip, you just want to untar it already!
#
# Usage: untar [-v|--verbose] file
#