Skip to content

Instantly share code, notes, and snippets.

View researcx's full-sized avatar
💼
Looking for work

Keira T. researcx

💼
Looking for work
View GitHub Profile
@researcx
researcx / check_xmrig.sh
Created April 14, 2022 11:03
check if xmrig is running
#!/bin/bash
PROCESS=`ps -eaf | grep xmrig | grep -v grep`
if [ "$PROCESS" == '' ]
then
/home/monero/xmrig -B
else
echo "xmrig running"
fi
@researcx
researcx / check_time_weather_condition.sh
Created April 15, 2022 02:49
check weather and time conditions
#!/bin/bash
LOCATION="Hampshire"
CONDITION=`curl -s wttr.in/$LOCATION?format=%C`
SUNSET=`curl -s wttr.in/$LOCATION?format=%s`
SUNRISE=`curl -s wttr.in/$LOCATION?format=%S`
TIME=`date "+%H:%M:%S"`
sunset_time=$(date -d $SUNSET +%s)
@researcx
researcx / discord_export_friends.py
Created April 26, 2022 01:09
export discord tags & permanent userids w/ discord.py
#!/usr/bin/python3
import discord
token = ("")
class ExportFriends(discord.Client):
async def on_connect(self):
friendslist = client.user.friends
for user in friendslist:
try:
print(user.name+"#"+user.discriminator + " ("+str(user.id)+")")
@researcx
researcx / config.fish
Created August 30, 2022 07:33
fish config
function fish_greeting
echo ""
neofetch
end
set LC_ALL en_GB.UTF-8
set LANG en_GB.UTF-8
set LANGUAGE en_GB.UTF-8
alias psg="ps aux | grep"
@researcx
researcx / pydirlist.service
Created September 13, 2022 04:11
pydirlist service file for systemd
[Unit]
Description=pydirlist
After=network.target
[Service]
User=myuser
WorkingDirectory=/path/to/pydirlist
ExecStart=bash /path/to/pydirlist/run.sh
Restart=always
@researcx
researcx / pydirlist
Created September 13, 2022 04:13
pydirlist service file for openrc
#!/sbin/openrc-run
depend() {
need net
}
srv="/path/to/pydirlist/"
command="/bin/sh /path/to/pydirlist/run.sh"
command_args=""
command_user="myuser:mygroup"
@researcx
researcx / angristan-openvpn-easy-renew.sh
Last active September 13, 2022 15:41
easy renew angristan openvpn certs
#!/bin/bash
# Commands to renew certificates for angristan's openvpn-install
# https://github.com/angristan/openvpn-install
# CREDIT: https://github.com/angristan/openvpn-install/issues/1002#issuecomment-1229525488
# https://github.com/kg6uyz
NAME=$(cat /etc/openvpn/easy-rsa/SERVER_NAME_GENERATED)
vm.swappiness = 1
vm.dirty_background_ratio = 3
vm.dirty_ratio = 40
vm.dirty_background_bytes = 4194304
vm.dirty_bytes = 4194304
vm.vfs_cache_pressure = 50
net.core.netdev_max_backlog = 16384
net.core.somaxconn = 8192
net.core.rmem_default = 1048576
net.core.rmem_max = 16777216
vm.vfs_cache_pressure = 500
vm.swappiness = 90
vm.dirty_background_ratio = 1
vm.dirty_ratio = 50
vm.dirty_background_bytes = 4194304
vm.dirty_bytes = 4194304
net.core.netdev_max_backlog = 16384
net.core.somaxconn = 8192
net.core.rmem_default = 1048576
net.core.rmem_max = 16777216
@researcx
researcx / githubrepos.py
Last active September 27, 2022 15:29
periodically make a html page of your github repos (requires github cli tools (gh command))
import json, humanize, os, html
from datetime import datetime, timedelta
file = '/home/keira/Repositories/Public/github.html'
github_json_file = '/home/keira/Resources/github.json'
# cron every 30 minutes:
# */30 * * * * /usr/bin/gh repo list researcx -L 400 --visibility public --json name,owner,pushedAt,isFork,diskUsage,description > /home/keira/Resources/github.json
# */31 * * * * /usr/bin/python3 /home/keira/Scripts/githubrepos.py