Skip to content

Instantly share code, notes, and snippets.

Avatar

Vpnwall Services vpnwall-services

View GitHub Profile
@vpnwall-services
vpnwall-services / Load-Stress-Tests-101.md
Created Nov 24, 2020
[Load/Stress Tests 101] Load/Stress Tests 101 #load #stress #tests #101 #test
View Load-Stress-Tests-101.md

Load Test RAM

stress-ng --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1

@vpnwall-services
vpnwall-services / add-disk-to-lvm.sh
Created Nov 16, 2020
[Add disk to LVM] Add disk to LVM #bash #lvm #resize #add #extend #space #disk
View add-disk-to-lvm.sh
#!/bin/bash
umount /vgmountpoint
pvscan
fdisk /dev/sdb => n => p => * => * => t => 8e => w
pvcreate /dev/sdb1
vgextend VolGroup00 /dev/sdb1
pvscan
lvextend -l +100%FREE /dev/VolGroup00/LogVol00
lvm vgchange -a y
e2fsck -f /dev/VolGroup00/LogVol00
@vpnwall-services
vpnwall-services / wordpress-api-whitelist
Created Nov 10, 2020
[Wordpress API Whitelist] Wordpress API Whitelist #bash #apache2 #htaccess #wordpress #api #whitelist #restriction
View wordpress-api-whitelist
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !=xxx.xxx.xxx.xxx
RewriteCond %{REQUEST_URI} /wp-json/ [NC]
RewriteRule . - [F,L]
@vpnwall-services
vpnwall-services / PDHS.py
Created Nov 2, 2020
[Python Dummy Http Server] Python Dummy Http Server #python #dummy #http #server
View PDHS.py
import SimpleHTTPServer
import SocketServer
PORT = 9999
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("localhost", PORT), Handler)
print "serving at port", PORT
@vpnwall-services
vpnwall-services / salt_adhoc_command_for_tunnel.sh
Created Oct 30, 2020
[Saltstack Execute tunnel for remote access] Saltstack Execute tunnel for remote access #bash #saltstack #ssh #tunnel
View salt_adhoc_command_for_tunnel.sh
#!/bin/bash
salt 'mynode' cmd.run '/usr/bin/autossh -M 0 -o "StrictHostKeyChecking=no" -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -o ExitOnForwardFailure=yes -o "ServerAliveInternal=30" -o ServerAliveCountMax=3 -i /root/.ssh/id_rsa -NR 7999:localhost:22 myremoteuser@remoteserver.public -p 2222 &'
@vpnwall-services
vpnwall-services / OVH-Change-Kernel.sh
Created Oct 28, 2020
[OVH Change Kernel] OVH Change Kernel #OVH #change #kernel #bash
View OVH-Change-Kernel.sh
#!/bin/bash
cd /etc/grub.d
mv 10_linux 96_OVHkernel
apt install linux-image-4.19.0-12-amd64
apt install linux-headers-4.19.0-12-amd64
update-grub
#https://askubuntu.com/questions/871336/switching-from-ovh-kernel-to-default-kernel-without-reinstalling-ubuntu
@vpnwall-services
vpnwall-services / Mysql-find-orphaned-images.sql
Created Oct 27, 2020
[MYSQL Find orphaned images] Mysql find orphaned images #mysql #find #orphaned #images
View Mysql-find-orphaned-images.sql
SELECT
*
FROM
wp_posts i
WHERE
i.post_type = 'attachment'
AND
NOT EXISTS (SELECT * FROM wp_posts p WHERE p.ID = i.post_parent)
AND
NOT EXISTS (SELECT * FROM wp_postmeta pm WHERE pm.meta_key = '_thumbnail_id' AND pm.meta_value = i.ID)
@vpnwall-services
vpnwall-services / Mysql-to-Json.sql
Last active Oct 27, 2020
[MYSQL TO JSON] Mysql data to json #mysql #to #json
View Mysql-to-Json.sql
select JSON_OBJECT
('id', id,
'user_login', user_login,
'user_pass', user_pass,
'user_nicename', user_nicename,
'user_email', user_email,
'user_url', user_url,
'user_registered', user_registered,
'user_activation_key', user_activation_key,
'user_status', user_status,
@vpnwall-services
vpnwall-services / GRAYLOG-101.md
Created Oct 27, 2020
[GRAYLOG 101] Graylog 101 #graylog #101
View GRAYLOG-101.md
@vpnwall-services
vpnwall-services / apache2-benchmarking-101.md
Created Oct 19, 2020
[Apache2 Benchmarking 101] Apache2 benchmarking 101 #bash #apache2 #benchmarking #101 #debian
View apache2-benchmarking-101.md

APACHE2 BECNHMARKING 101

Simple becnhmark

ab -t 30 -n 16000 -c 100 https://myurl.local/

Becnhmark while connected with curl request use

You can’t perform that action at this time.