Skip to content

Instantly share code, notes, and snippets.

View keltia's full-sized avatar

Ollivier Robert keltia

View GitHub Profile
@jpmens
jpmens / arpaname.py
Created December 1, 2022 15:10
Ansible filter convert IP to arpaname
# arpaname.py, (C)2022 by Jan-Piet Mens <jp@mens.de>
# Convert an IPv4 or IPv6 address in textual form into a string whose value is
# the reverse-map domain name of the address.
#
# - debug: msg="{{ "192.168.1.3" | arpaname }}"
# "3.1.168.192.in-addr.arpa."
#
# - debug: msg="{{ "2001:DB8::7" | arpaname }}"
# "7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa."
@mcastorina
mcastorina / Cargo.toml
Created August 6, 2020 02:03
Clap and rustyline tab completion integration
[package]
name = "tmp"
version = "0.1.0"
authors = ["Miccah Castorina <m.castorina93@gmail.com>"]
edition = "2018"
[dependencies]
clap-v3 = { version = "3.0.0-beta.1", features = ["yaml"] }
rustyline = "6.2.0"
serde_yaml = "0.8"
@mizhka
mizhka / sysctl-tunables
Created June 4, 2019 09:40
FreeBSD 13-GENERIC-CURRENT tunables
kern.maxproc: Maximum number of processes
kern.ngroups: Maximum number of supplemental groups a user can belong to
kern.ipc.shm_allow_removed: Enable/Disable attachment to attached segments marked for removal
kern.ipc.shm_use_phys: Enable/Disable locking of shared memory pages in core
kern.ipc.shmall: Maximum number of pages available for shared memory
kern.ipc.shmseg: Number of segments per process
kern.ipc.shmmni: Number of shared memory identifiers
kern.ipc.shmmin: Minimum shared memory segment size
kern.ipc.shmmax: Maximum shared memory segment size
kern.ipc.semaem: Adjust on exit max value
@fdv
fdv / .tmux.conf
Last active May 3, 2024 02:02
Emoji / UTF-8 in IRSSI with tmux. Tested on FreeBSD 11.3 with zsh 5.6.2, tmux 2.7 and irssi 1.1.1 or later
#
set -g default-terminal screen-256color
set -g status-bg blue
set -g status-fg white
set -g status-right '#(sysctl vm.loadavg)'
setw -g window-status-current-attr underscore
bind r source-file ~/.tmux.conf
@dlangille
dlangille / 0 - the problems
Last active December 17, 2018 22:29
Let's upgrade one ezjail to iocage
The list of 'symlink has no referent' ... those all have to be created by hand, with no easy way to know what they should be.
We want [most of?] them to persist in the new jail.
How do to that?
@fdv
fdv / Install.md
Last active April 16, 2018 10:00
Dhclient6 for FreeBSD configuration

Install the package

pkg install isc-dhcp43-client

/etc/rc.conf

ipv6_enable_all_interfaces="YES"
@bortzmeyer
bortzmeyer / bgproute.md
Created June 20, 2017 11:47
Get the AS (IPv4 only) froma DNS request
bgproute () {
	if [ -z "$1" ]
	then
		echo "Usage: bgproute IP-address"
		return 1
	fi
	dig +short TXT `echo $1 |                awk -F. '{print $4 "." $3 "." $2 "." $1 ".aspath.routeviews.org" }'` | awk -F\" '{print "AS path: " $2 "\nRoute: " $4 "/" $6}'
}
@tut-tuuut
tut-tuuut / delete-tweets-from-twitarchive.rb
Last active May 17, 2018 20:12
Delete every tweet contained in your tweet archive. Forked from https://gist.github.com/robinsloan/3688616
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = ""
TWITARCHIVE_TWEETS = "/eg/path/to/your/twitarchive/data/js/tweets"
# get these from dev.twitter.com
CONSUMER_KEY = ""
@dlangille
dlangille / 01 - the plan
Last active May 22, 2017 02:10
Description of a centralized LetsEncrypt strategy
I'm basing this on https://blog.crashed.org/letsencrypt-in-freebsd-org/
I'll create a new jail: certs.int.unixathome.org

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru