Skip to content

Instantly share code, notes, and snippets.

View FromeXo's full-sized avatar

Robin Johansson FromeXo

View GitHub Profile
@FromeXo
FromeXo / apk.sql
Created October 14, 2025 15:19
APK
MariaDB [scrape]> SELECT
-> `c`.`name` AS `Category`,
-> `p`.`name`,
-> `p`.`volume`,
-> `p`.`recycle_fee` + `p`.`price` AS `Price`,
-> MAX(`p`.`apk`) AS `APK`
-> FROM
-> `categories` AS `c`
-> LEFT JOIN
-> `products` AS `p`
@FromeXo
FromeXo / World Of Warcraft Macro - General.lua
Last active July 28, 2025 15:12
World Of Warcraft Macro - General
-- Use Trinket
-- Trinket 1
#showtooltip
/use 13
-- Trinket 2
#showtooltip
/use 14
--------------------------
@FromeXo
FromeXo / iptables
Last active February 6, 2024 17:53
iptables
iptables -F
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Allow everything on loopback interface
iptables -A INPUT -i lo -j ACCEPT
# SSH
@FromeXo
FromeXo / install_faillock.sh
Last active February 1, 2024 15:13
install faillock
#!/usr/bin/env bash
# Default Script Vars
readonly SCRIPT_VERSION="1.0.0"
readonly SCRIPT_PATH=$(realpath "$0")
readonly SCRIPT_FILE=${SCRIPT_PATH##*/}
readonly SCRIPT_DIR=${SCRIPT_PATH%/*}
# faillock config file location
fl_conf_file="/etc/security/faillock.conf"
@FromeXo
FromeXo / common-auth
Created February 1, 2024 15:00
/etc/pam.d/common-auth
#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
@FromeXo
FromeXo / faillock.conf
Last active February 1, 2024 14:43
Default faillock.conf
# Configuration for locking the user after multiple failed
# authentication attempts.
#
# The directory where the user files with the failure records are kept.
# The default is /var/run/faillock.
# dir = /var/run/faillock
#
# Will log the user name into the system log if the user is not found.
# Enabled if option is present.
# audit
@FromeXo
FromeXo / .boschrc
Last active April 3, 2023 09:39
Display IPs in a cool way
if command -v jq &> /dev/null
then
echo "IPs"
ip -j -4 addr show | jq '.[].addr_info[] | .label + ": " + .local' | tr -d '"' | awk '{print $1 " " $2}'
fi
@FromeXo
FromeXo / netPing.js
Last active January 7, 2022 20:17
Quick and dirty node script for seaching private ips.
const exec = require('child_process').exec;
const options = {
net: '192.168.0',
start: 1,
end: 256,
verpose: false
};
process.argv.slice(2).forEach( (val, index, array) => {
@FromeXo
FromeXo / scrape
Last active April 9, 2020 11:08
nej
var cDate = new Date();
function f_ts(time) {
let d = time.getFullYear() + '-' + ('0' + (time.getMonth()+1)).slice(-2) + '-' + ('0' + time.getDate()).slice(-2);
return d + ' ' + ('0' + (time.getHours())).slice(-2) +':'+('0' + (time.getMinutes())).slice(-2)+':00';
}
function h_t_m(h) {return ((parseInt(h) * 60) * 60) * 1000;}
function m_t_m(m) {return (m * 60) * 1000;}
function hm_t_m(x) {
x = x.split(':');
/*******************************************************************************
* Luhn-algoritmen
*
* Calculate the controll digit in a swedish social security number.
*
* @param String ssn 12 digit ssn with a dash befor the 4 last digits.
******************************************************************************/
function checkLastDigit (ssn) {
// Remove the dash from ssn