Skip to content

Instantly share code, notes, and snippets.

@LordShedy
LordShedy / regfere.py
Created May 14, 2020 22:07
Regex Find And Replace Script
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Regex Find And Replace script"""
import sys
import re
import argparse
def read_file_split_lines(data_file_path):
"""
function bk() {
if [[ -z $1 ]]; then
echo "Please, enter a path to a file to create the backup file of!"
else
local __path=${1}
local __timestamp=`date +'%Y%m%d%H%M'`
local __backup_file="${__path}.${__timestamp}.bk"
[[ -f "${__path}" ]] && cp "${__path}" "${__backup_file}"
echo "File "$1" was backed up as ${__backup_file}"
fi
@LordShedy
LordShedy / pokemon_go_apprisal.py
Created May 10, 2020 13:34
A Python script for getting Pokémon IV percentage from its appraisal.
#!/usr/bin/env python3
from enum import Enum
class Rates(Enum):
A = 15
B = 14
C = 13
D = 12
E = 11
@LordShedy
LordShedy / blocklist.txt
Last active January 30, 2020 12:33
BlockList for DNSCrypt
This file has been truncated, but you can view the full file.
00005ik.rcomhost.com
0001.2waky.com
000free.us
000freexxx.com
000.gaysexe.free.fr
000lk3v.wcomhost.com
000lkub.rcomhost.com
000ll4q.rcomhost.com
000lp59.wcomhost.com
000m9w3.wcomhost.com
#!/bin/bash
DPKGS=(python3 python3-pip)
PIPS=(requests datetime)
# check if user running script is root
if [[ "$EUID" != 0 ]]
then
echo "Please, run this script with superuser privileges."
exit 1
fi
@LordShedy
LordShedy / jlav.py
Last active October 3, 2019 09:40
JSON Loader And Validator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# created by Lord Shedy
# version: 1.0.1
import json
from jsonschema import validate
from datetime import datetime
"""
@LordShedy
LordShedy / checksumcontent.sh
Created July 18, 2019 07:23
Checking content of a file
#!/bin/bash
if [[ "$#" -lt 0 ]]
then
echo "Too little arguments, this script need some files to check!"
exit 0
fi
for i in "$@"
do
@LordShedy
LordShedy / var_dump-cleanser.py
Last active August 7, 2021 22:42
I like using the funcion of var_dump to debug my python code but after the debuggement is over I am too lazy to delete the lines containing var_dump, this script I wrote does it for you.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import logging
import re
LOGGER = logging.getLogger()
LOGGER_SEVERITY = logging.DEBUG
@LordShedy
LordShedy / .Xmodmap
Last active June 24, 2019 13:30
keycode (number) = (key by itself) (Shift+key) (mode_switch+key) (mode_switch+Shift+key) (Alt Graph+key) (Alt Gra ph+Shift+key)
keycode 8 =
keycode 9 = Escape NoSymbol Escape NoSymbol Escape Escape
keycode 10 = plus 1 1 exclam exclam dead_tilde 1 exclam
keycode 11 = ecaron 2 2 at at dead_caron 2 at
keycode 12 = scaron 3 3 numbersign numbersign dead_circumflex 3 numbersign
keycode 13 = ccaron 4 4 dollar dollar dead_breve 4 dollar
keycode 14 = rcaron 5 5 percent percent dead_abovering 5 percent
keycode 15 = zcaron 6 6 asciicircum asciicircum dead_ogonek 6 asciicircum
keycode 16 = yacute 7 7 ampersand ampersand dead_grave 7 ampersand
keycode 17 = aacute 8 8 asterisk asterisk dead_abovedot 8 asterisk
@LordShedy
LordShedy / .conkyrc
Last active August 10, 2021 06:08
Conky
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
conky.config = {
alignment = 'top_left',
background = false,
border_width = 0.5,
cpu_avg_samples = 4,
default_color = 'white',
default_outline_color = 'grey',
default_shade_color = 'black',
draw_borders = true,