This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Use Trinket | |
-- Trinket 1 | |
#showtooltip | |
/use 13 | |
-- Trinket 2 | |
#showtooltip | |
/use 14 | |
-------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(':'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* 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 |