Skip to content

Instantly share code, notes, and snippets.

@mrbloopbloop
mrbloopbloop / secure.sh
Last active October 10, 2023 16:05
Script to provide initial security steps to a Linux Server
# secure.sh
# Enable automatic updates.
apt install -y unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades
# Limited access user
echo
echo Creating limited access user...
echo Enter new username.
@mrbloopbloop
mrbloopbloop / dwm_config_pulseaudio.h
Last active January 25, 2021 04:09 — forked from palopezv/dwm_config_pulseaudio.h
dwm volume control with hardware multimedia keys (pulseaudio)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You need the X11 development package installed, but here is the upstream copy
of this header if you can't bother using the contents of your own hard drive. ;-P
https://cgit.freedesktop.org/xorg/proto/x11proto/tree/XF86keysym.h
@mrbloopbloop
mrbloopbloop / Python36.sh
Created June 15, 2018 02:46
Install Python 3.6 on linux
sudo apt-get install -y python3.6
@mrbloopbloop
mrbloopbloop / Server.js
Last active June 11, 2018 13:23
Basic web server in NodeJS
console.log("Loading dependencies...");
// This is how you include a NodeJS library.
var http = require("http");
var fs = require("fs");
console.log("Initializing server...");
var rootDir = "/www/";
var port = 80;
function err404 (res) {
@mrbloopbloop
mrbloopbloop / warden.py
Created February 16, 2017 05:47
A program that uses pygame to take an image and put it in a hidden directory. Usefull script to run at startup.
#!/user/bin/env python
import pygame
import pygame.camera
import time as t
breach = str(t.time())
pygame.camera.init()
cam = pygame.camera.Camera()
@mrbloopbloop
mrbloopbloop / Ceasar.py
Last active February 10, 2017 10:50
Caesar Cipher - a basic Caesar cipher. A negative key is required for decryption.
import string
def caesar(key, text):
alpha = dict(zip(string.ascii_lowercase,range(26)))
beta = {v: k for k, v in alpha.items()}
text, other, result = text.lower(), ['.', '?', ',', ' ', '!'], []
for i in text:
index = alpha[i] + key
for j in other:
result.append(i) if i == j else pass
result.append(beta[index]) if 25 > index + key > 0 else result.append(beta[index - 25])
@mrbloopbloop
mrbloopbloop / Collatz.py
Created February 10, 2017 09:50
Collatz Conjecture - Count the number of steps to get to one from any integer greater than one where a step is "divide by 2" if it is even or "multiply by 3 and add 1" if it is odd.
def Collatz(integer):
number = integer
count = 0
while number > 1:
if number%2 == 0:
number = number / 2
else:
number = number*3 +1
count = count +1
return count