Skip to content

Instantly share code, notes, and snippets.

Avatar

Keira T. researcx

View GitHub Profile
@researcx
researcx / discord_export_friends.py
Created Apr 26, 2022
export discord tags & permanent userids w/ discord.py
View discord_export_friends.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 / check_time_weather_condition.sh
Created Apr 15, 2022
check weather and time conditions
View check_time_weather_condition.sh
#!/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 / check_xmrig.sh
Created Apr 14, 2022
check if xmrig is running
View check_xmrig.sh
#!/bin/bash
PROCESS=`ps -eaf | grep xmrig | grep -v grep`
if [ "$PROCESS" == '' ]
then
/home/monero/xmrig -B
else
echo "xmrig running"
fi
View DonateBot.py
#!/usr/bin/python
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from re import search, IGNORECASE
from random import randint
import time
import os, signal
serv_ip = "10.3.0.50"
serv_port = 6667
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@researcx
researcx / remove all *.log files on system.md
Last active Sep 10, 2021
an extremely bad idea indeed
View remove all *.log files on system.md

find / -iname "*.log" > /root/scripts/logs.txt

root/scripts/truncate-logs.sh:

#!/bin/bash
FILENAME="/root/scripts/logs.txt"
LINES=$(cat $FILENAME)

for LINE in $LINES
do
View gist:fcf93b65e28f5635eb5f2d08125820fd
### Keybase proof
I hereby claim:
* I am researcx on github.
* I am researcx (https://keybase.io/researcx) on keybase.
* I have a public key ASD83ceD9-f7-0vbpVx_I6PlhL7dJI4-unLtjglbrO7zsgo
To claim this, I am signing this object:
@researcx
researcx / full-backup.sh
Created Oct 1, 2020
server backup script for host files and lxd containers (supports backing up into luks images)
View full-backup.sh
#!/bin/bash
#set -x
# configuration
hostname=$(hostname)
lxc="/snap/bin/lxc"
path="/mount/backups/$hostname/"
path_host=$path"host/"
@researcx
researcx / get-latest-element.sh
Last active Sep 29, 2020
element-web auto-updater script
View get-latest-element.sh
# element-web auto-updater script by unendingPattern ( unendingpattern.github.io )
# fetches the latest element (matrix client) release for self-hosting
# requirements: curl, jq, tar
# cron:
# @hourly /bin/sh /path/to/get-latest-element.sh
# OR
# 0 * * * * /bin/sh /path/to/get-latest-element.sh
# functions
@researcx
researcx / luks-encrypt-in-place.sh
Created Sep 18, 2020 — forked from samdoran/luks-encrypt-in-place.sh
Encrypt a physical volume using LUKS without erasing the drive.
View luks-encrypt-in-place.sh
#!/bin/bash
# Encrypt existing hard drive in place.
# Requires a second physical drive to temporarily store data. This drive will be erased.
# This script is meant to be run on Clonezilla 1.2.9-19 or later.
# The cryptsetup syntax is different in Clonezilla than in Red Hat.
# --- Variables --- #