Skip to content

Instantly share code, notes, and snippets.

View n0nuser's full-sized avatar
👽

Pablo González Rubio n0nuser

👽
View GitHub Profile
@n0nuser
n0nuser / .bash_aliases
Last active August 31, 2021 11:18
My Bash aliases
alias aliases="source ~/.bash_aliases"
# OS
alias poweroff="halt -p"
# Reboot and forever with No Gui
alias rebootNoGui='sudo systemctl set-default multi-user && sudo reboot'
# Reboot and forever with Gui
@n0nuser
n0nuser / Networking.py
Last active March 19, 2021 08:39
Networking related Python Functions
import re
import socket
import struct
import platform
import subprocess
# https://stackoverflow.com/a/166589
def getWANIP():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
@n0nuser
n0nuser / config.toml
Last active April 12, 2021 10:40
Using Google Analytics 4 with GoHugo
# Page settings
baseURL = "baseurl"
languageCode = "en"
title = "Hey! I'm using GA4"
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
@n0nuser
n0nuser / rc.lua
Created April 13, 2021 23:26
Arch Awesome
awful.keyboard.append_global_keybindings({
-- Volume Control
-- https://bbs.archlinux.org/viewtopic.php?pid=958820#p958820
awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("mpc toggle") end),
awful.key({ }, "XF86AudioNext", function () awful.util.spawn("mpc next") end),
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("mpc prev") end),
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer -c 0 set Master 1dB+") end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer -c 0 set Master 1dB-") end),
awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer -c 0 set Master toggle") end),
})
@n0nuser
n0nuser / arch_install.md
Last active January 22, 2022 17:04
My Arch Install

Arch Linux Installation - EFI

Pre-Installation

Loading keyboard

loadkeys es
@n0nuser
n0nuser / aes.py
Created August 27, 2021 08:13
Encryption with Python
from Crypto.Cipher import AES # Use cryptodome!!
import base64
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS).encode()
unpad = lambda s: s[:-ord(s[len(s)-1:])]
def iv():
return chr(0) * 16
@n0nuser
n0nuser / main.py
Last active February 23, 2022 17:19
Python functions
def randomPassword(length):
"""
pass = randomPassword(16)
Ref: https://stackoverflow.com/a/2257449
"""
return(''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(length)))
def _get_size(bytes: int, suffix="B"):
"""Scale bytes to its proper format.
e.g:
@n0nuser
n0nuser / executeQuery.py
Last active November 28, 2022 13:51
Execute query in files from a folder into a MS SQL Server continuosly
#!/usr/bin/python3
###############################################################################################
# Author: n0nuser - Pablo Jesús González Rubio - https://nonuser.es - gonzrubio.pablo@gmail.com
###############################################################################################
#
# Traverses files in a folder, executing the query in each file to a MS SQL Server
#
# If it succeeds, the file could be deleted
#
# If there's any error with a file (execution of query or not able to read file),
@n0nuser
n0nuser / manual-of-me-questions.md
Last active December 5, 2022 10:43
Manual of Me Questions

Manual of Me - Questions

Profesional

Job related

  • The times/hours I like to work / Structure of my day
  • An ideal day at work looks like...
  • I do my best work when...
  • How I view success