This file contains 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 bluebird = require('bluebird'); | |
var crypto = require('crypto'); | |
var forge = require('node-forge'); | |
var fs = require('fs'); | |
var data = {}; | |
var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; | |
function base32encode(value) { |
This file contains 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
<?php | |
// config params | |
$conf = file_get_contents("/path/to/config.json"); | |
// query string params | |
$qstr = $_GET; | |
// API params | |
$apiurl = "https://www.google.com"; |
This file contains 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
<?php | |
function getUserIP() | |
{ | |
$client = @$_SERVER['HTTP_CLIENT_IP']; | |
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; | |
$remote = $_SERVER['REMOTE_ADDR']; | |
if(filter_var($client, FILTER_VALIDATE_IP)) | |
{ |
This file contains 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
## Remove Old Kernels ## | |
## Fedora 21/20/19/18/17/16, CentOS, Red Hat (RHEL) ## | |
yum install yum-utils | |
## Package-cleanup set count as how many old kernels you want left ## | |
package-cleanup --oldkernels --count=2 | |
## Add ifconfig ## | |
yum install net-tools | |
## Add nginx ## |
This file contains 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
# | |
sudo yum install net-tools mc wget | |
sudo yum groupinstall "Development Tools" | |
sudo yum install kernel-devel | |
# add the latest nginx | |
# touch /etc/yum.repos.d/nginx.repo | |
# [nginx] | |
# name=nginx repo | |
# baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ |
This file contains 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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) # or docker ps -q -a | xargs docker rm | |
# Delete all images | |
docker rmi $(docker images -q) | |
# delete all untagged images | |
docker rmi $(docker images | grep “^<none>” | awk ‘{print $3}’) |
This file contains 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
echo Uninstalling KB3075249 (telemetry for Win7/8.1) | |
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart | |
echo Uninstalling KB3080149 (telemetry for Win7/8.1) | |
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart | |
echo Uninstalling KB3021917 (telemetry for Win7) | |
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart | |
echo Uninstalling KB3022345 (telemetry) | |
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart | |
echo Uninstalling KB3068708 (telemetry) | |
start /w wusa.exe /uninstall /kb:3068708 /quiet /norestart |
This file contains 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
# Dumping the database structure for all tables with no data | |
# Dumping the MySQL | |
mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql | |
# Dumping the SQlite | |
sqlite3 databasefile.db .sch > dumpfile.sql | |
# Dumping the PostgreSQL | |
pg_dump --schema-only databasename > dumpfile.sql |
This file contains 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
#!/bin/bash | |
# NodeJS, NPM, Nginx | |
sudo apt-get update | |
sudo apt-get install nodejs-legacy npm nginx-extras -y | |
# RabbitMQ | |
sudo echo "deb http://www.rabbitmq.com/debian/ testing main" > /etc/apt/sources.list.d/rabbitmq.list | |
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
sudo apt-key add rabbitmq-signing-key-public.asc |
This file contains 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
# split string by space | |
# awk -F " " '{print $7}' | |
# example: show banned ip | |
cat /var/log/fail2ban.log | grep Ban | awk -F " " '{print $7}' | |
# count unique value | |
# sort | uniq -c | sort -nr | |
# example: count banned unique ip | |
cat /var/log/fail2ban.log | grep Ban | awk -F " " '{print $7}' | sort | uniq -c | sort -nr |
NewerOlder