hi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 90; | |
disp(primePair(n)) | |
function p = primePair(n) | |
% Incredibly inefficient, use the primes vector instead. | |
% I just came up with this during an exam and didn't want | |
% to think about going over the vector correctly too much. | |
a = [ -2 0 ]; | |
counter = 0; | |
while counter ~= n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count_equal_to_6 = 0; | |
for times = 1:1000 | |
if sumOfDigits(times) == 6 | |
display(times) | |
count_equal_to_6 = 1 + count_equal_to_6; | |
end | |
end | |
fprintf('Total: %d\n', count_equal_to_6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I know this is dirty, but come on, starting my Windows virtual machine | |
# just freezes everything and the whole thing won't even respond to `systemctl`. | |
# | |
# Use with root privileges, not my responsibility if you mess things up. | |
pkill -9 libvirt | |
rm -rf /run/libvirtd.pid | |
rm -rf /run/libvirt/interface/driver.pid | |
rm -rf /run/libvirt/secrets/driver.pid | |
rm -rf /run/libvirt/nodedev/driver.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
optipng image.png | |
convert image.png -define icon:auto-resize=16,32,48,57,64,96,128,144,192,196,256 favicon.ico |
- Install Debian (or your distro of choice) in a virtual machine.
- Configure OpenVPN/Wireguard.
- Install
dante-server
and paste the contents ofdanted.conf
in/etc/danted.conf
. - Make the appropriate changes to the aforementioned configuration file.
- Run
ip a
and take note of the IP address of the virtual machine. - Run
sudo systemctl enable --now danted
. - Ensure that the proxy is functioning properly with
sudo systemctl status danted
. - If all went well, you should now be able to connect to your SOCKS5 proxy!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://stackoverflow.com/questions/39686553/what-does-python-return-on-the-leap-second | |
import time | |
import datetime as dt | |
time.mktime(time.strptime('2016-06-30T23:59:59', "%Y-%m-%dT%H:%M:%S")) | |
time.mktime(time.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S")) | |
# datetime will fail | |
dt.datetime.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://acme.dn42/dn42acme.pem | |
sudo cp dn42acme.pem /etc/ssl/certs | |
sudo openssl x509 -noout -hash -in dn42acme.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip addr show dev eth0 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' | grep -v "fe80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; | |
do | |
sudo echo $((0 + RANDOM%2)) | | |
sudo tee /sys/class/leds/*/brightness -; | |
sleep 0.005; | |
done |
NewerOlder