Skip to content

Instantly share code, notes, and snippets.

View Rmlyy's full-sized avatar
👋

Rmly Rmlyy

👋
View GitHub Profile
@Rmlyy
Rmlyy / upload
Created June 20, 2021 07:50
Command line upload script
#!/bin/bash
file=$1
if [[ -z $1 ]]; then
echo "Please specify a file."
exit
fi
if [[ ! -f "$file" ]]; then
echo "$file does not exist."
@Rmlyy
Rmlyy / screenshot
Last active March 24, 2022 21:43
Flameshot upload script
#!/bin/bash
# Base: https://github.com/notmeta/flameshot-s3-uploader
url="url"
key="secretkey"
temp_file="/tmp/screenshot.png"
flameshot gui -r > $temp_file
if [[ $(file --mime-type -b $temp_file) != "image/png" ]]; then
rm -rf $temp_file
@Rmlyy
Rmlyy / start.sh
Created July 12, 2021 10:28
Auto-restart shell script
#!/bin/sh
while true
do
java -Xms512M -Xmx512M -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -jar waterfall.jar
for s in 5 4 3 2 1
do
echo "Restarting in ${s} second(s)..."
sleep 1
done
@Rmlyy
Rmlyy / allow.sh
Created November 19, 2021 21:35
Allow connections on port 80 from Cloudflare
#!/bin/sh
for ip in $(curl -s https://www.cloudflare.com/ips-v4)
do
sudo ufw allow from $ip to any port 80 proto tcp
done
@Rmlyy
Rmlyy / brightness
Created December 17, 2021 19:27
Change screen brightness by 10%
#!/bin/sh
brightness="/sys/class/backlight/intel_backlight/brightness"
current=$(cat $brightness)
if [ $1 -eq 0 ]; then
new=$(( current + 10000 ))
else
new=$(( current - 10000 ))
fi
@Rmlyy
Rmlyy / game.py
Created January 31, 2022 15:43
Guessing game in Python
from random import randint
min = 1
max = 10
number = randint(min, max)
tries = 1
while True:
print(f'Try {tries}')
answer = input(f'Guess the number between {min} and {max}: ')
@Rmlyy
Rmlyy / ddns
Created March 12, 2022 17:18
Minimal Cloudflare Dynamic DNS
#!/bin/bash
ip=$(curl -s myipv4.r0.al)
date=$(date +'[%m.%d.%Y %r]:')
api_key=""
zone_id=""
dns_identifier=""
name=""
curl -s -f -X PUT "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records/$dns_identifier" \
-H "Authorization: Bearer $api_key" \
@Rmlyy
Rmlyy / install-discord
Created April 24, 2022 14:37
Script to install Discord on Debian 11
#!/bin/bash
if [ $EUID -ne 0 ]
then
echo "This script must be run as root"
exit
fi
if ! grep -q 11 '/etc/debian_version'
then
@Rmlyy
Rmlyy / index.html
Created October 18, 2022 19:08
manelizor d-ala
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Manelizor</title>
</head>
<body>
script_name('Fish-Utils')
script_author('Rmly')
script_version('1.0')
local sampev = require 'samp.events'
local prefix = "{0ed2e8}[FISH-UTILS]:{b9bcbd}"
function main()
repeat wait(100) until isSampAvailable()
local ts = thisScript()