Skip to content

Instantly share code, notes, and snippets.

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

█████ ██████ researcx

💼
Looking for work
View GitHub Profile
@researcx
researcx / redir-uredir-quickbuild.sh
Created February 2, 2020 21:34
redir and uredir quick build
sudo dnf -y groupinstall "Development Tools"
mkdir /src
cd /src
#redir
git clone https://github.com/troglobit/redir.git
cd redir
./autogen.sh
./configure
make -j5
@researcx
researcx / dd-alias.sh
Created April 23, 2020 18:49
bash dd confirmation function/alias for those who need it
function dd () {
local bold=$(tput bold)
local normal=$(tput sgr0)
local red=$(tput setaf 1)
local green=$(tput setaf 2)
local yellow=$(tput setaf 3)
local ddcommand=$(which dd)
local vars=""
@researcx
researcx / luks-encrypt-in-place.sh
Created September 18, 2020 07:46 — forked from samdoran/luks-encrypt-in-place.sh
Encrypt a physical volume using LUKS without erasing the drive.
#!/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 --- #
@researcx
researcx / get-latest-element.sh
Last active September 29, 2020 20:38
element-web auto-updater script
# 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 / full-backup.sh
Created October 1, 2020 20:52
server backup script for host files and lxd containers (supports backing up into luks images)
#!/bin/bash
#set -x
# configuration
hostname=$(hostname)
lxc="/snap/bin/lxc"
path="/mount/backups/$hostname/"
path_host=$path"host/"
@researcx
researcx / remove all *.log files on system.md
Last active September 10, 2021 20:32
an extremely bad idea indeed

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

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@researcx
researcx / DonateBot.py
Last active August 29, 2022 12:11
video game style chat donate message bot, set it to automatically run on a cron
#!/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
@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)+")")