Skip to content

Instantly share code, notes, and snippets.

View k0nsl's full-sized avatar
🎯
Focusing

k0nsl k0nsl

🎯
Focusing
View GitHub Profile
@k0nsl
k0nsl / debian-unnecessary-packages.sh
Last active December 8, 2023 18:09
Remove non-critical packages (Debian)
# ref. https://wiki.debian.org/ReduceDebian
apt-get remove acpi acpid aptitude at aspell aspell-en avahi-daemon bash-completion bc bin86 bind9-host ca-certificates console-common console-data console-tools dc debian-faq debian-faq-de debian-faq-fr debian-faq-it debian-faq-zh-cn dhcp dhcp3-client dnsutils doc-debian eject fdutils file finger foomatic-filters gettext-base groff gnupg gnu-efi hplip iamerican ibritish info ispell laptop-detect libavahi-compat-libdnssd1 libc6-amd64 manpages mtools mtr-tiny mutt netcat net-tools ncurses-term openssh-client openssh-server openssl pidentd ppp pppconfig pppoe pppoeconf read-edid reportbug ssh tasksel tcsh traceroute unzip usbutils vim-common vim-tiny wamerican w3m whois zeroinstall-injector zip -y
apt-get update
@k0nsl
k0nsl / php-ping.php
Created January 21, 2015 17:19
PHP ping script
<?php
/*
*
* Use the examples below to add your own servers. Coded by clone1018 [?]
*
*/
$title = "Simple Server Status"; // website's title
$servers = array(
'Google Web Search' => array(
@k0nsl
k0nsl / k0nsl-OpenSC.ws
Created November 16, 2013 09:16
A bit of chat with the founder of OpenSC.ws
/**
* NOTE
*
* This person was the founder of a community called OpenSC.ws http://zerosecurity.org/technews/the-real-owner-of-opensc-ws
*
*
* As for his obsession with 'nazism'...well, clearly he has issues.
*/
@k0nsl
k0nsl / A - Information
Created March 29, 2017 14:03 — forked from doonga/A - Information
Plex NGINX reverse proxy config using Cloudflare on Ubuntu 16.04
Credit where credit's due, I mainly used these 3 resources to get this all working. There were several others but I don't exactly remember which is which. So at least here are the 3 main places that I used.
The vast majority of this came from this link, the others helped me make it work for Plex.
http://emby.media/community/index.php?/topic/30975-reverse-proxy-with-ssl-hostname-routing-and-embyopenvpn-port-sharing/
https://gist.github.com/spikegrobstein/4384954
https://forums.plex.tv/discussion/207725/ubuntu-14-04-4-lts-plex-incorrectly-handles-lower-case-headers#latest
The data flow here is:
#!/bin/bash
#Mirror: https://k0nsl.org/blog/snippets/bench-cpu-sh/
#Installation von BC
apt-get install bc -y
#Infos über System
cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo )
cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
@k0nsl
k0nsl / centos7-wifi-hotspot
Created February 14, 2021 22:10
Centos 7 Wi-Fi Hotspot (nmcli)
This is probably the simplest way to create a Wi-Fi hotspot in Centos 7:
nmcli dev wifi hotspot ifname wifi-interface ssid "k0nsl-wifi" password "unsecure"
@k0nsl
k0nsl / keep-resolvers.sh
Created July 28, 2020 09:09
A sort of "set and forget" type of operation in order to not have your resolv.conf overwritten; uses two Danish resolvers (unicast and anycast respectively). Can be run once or placed in "/etc/cron.hourly" as "keep-resolvconf" -- remember to make it executable too. That is all.
#!/bin/sh
## this file can live in /etc/cron.hourly as "keep-resolvers".
sudo chattr -i /etc/resolv.conf
sudo chattr -e /etc/resolv.conf
sudo rm -f /etc/resolv.conf
sudo touch /etc/resolv.conf.tmp
sudo echo "nameserver 91.239.100.100" >> /etc/resolv.conf.tmp
sudo echo "nameserver 89.233.43.71" >> /etc/resolv.conf.tmp
@k0nsl
k0nsl / bench-with-cpu.sh
Last active July 7, 2020 23:24
bench-with-cpu.sh
Pleaase use this in the future:
https://raw.githubusercontent.com/k0nsl/k0nsl-misc/master/bench.sh
@k0nsl
k0nsl / blast-from-the-past.txt
Created January 7, 2016 20:15
A blast from the past. This is from the time when Irving originally caved in after his arrest in Austria. - HAC.
THE BALLAD OF DAVID "BLACKADDER" IRVING
(sung to the theme song of "Black Adder")
From some gormless public school,
Came forth Revision's brightest scholar,
Toffee-nosed, but he's no fool,
He raked in quids and marks and dollars!
Dave Irving, Dave Irving,
With nothing left to lose,
#clear log files recursively:
for i in $(find /var/log -type f); do cat /dev/null > $i; done