Skip to content

Instantly share code, notes, and snippets.

Vpnwall Services vpnwall-services

Block or report user

Report or block vpnwall-services

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vpnwall-services
vpnwall-services / full-wp-upgrader.sh
Last active Aug 12, 2019
[Complete Wordpress Upgrade With Backup] Complete Wordpress update with backup #bash #complete #wordpress #upgrade #with #backup
View full-wp-upgrader.sh
#!/bin/bash
PATH=""
cd $PATH
# UPGRADE
WPDBNAME=$(cat wp-config.php | grep DB_NAME | cut -d \' -f 4);WPDBUSER=$(cat wp-config.php | grep DB_USER | cut -d \' -f 4);WPDBPASS=$(cat wp-config.php | grep DB_PASSWORD | cut -d \' -f 4);WPDBHOST=$(cat wp-config.php|grep DB_HOST|cut -d \' -f 4);mysqldump -h ${WPDBHOST} -u ${WPDBUSER} -p${WPDBPASS} ${WPDBNAME} > ${WPDBNAME}.sql;rsync -avr {$WPDBNAME.sql,wp-admin,wp-includes,index.php,wp-activate.php,wp-blog-reader.php,wp-comments-post.php,wp-cron.php,wp-links-opml.php,wp-load.php,wp-login.php,wp-mail.php,wp-settings.php,wp-signup.php,wp-trackback.php,xmlrpc.php,wp-content} --exclude=wp-content/{download,uploads} /root/$MYPWD;sudo -u www-data wp --path=$PWD core update --version=5.2.2 ;sudo -u www-data wp --path=$PWD core update-db;sudo -u www-data wp --path=$PWD plugin update --all
@vpnwall-services
vpnwall-services / debugger.md
Created Aug 11, 2019
[Socket.IO + Laravel Echo + JS] Debugging commands for socket.io, laravel echo and javascript #socketio #laravelecho #js #web #debugging
View debugger.md

Debugger

  • Debuggin socket.io (allow pasting), then paste this ! localStorage.debug = '*';
@vpnwall-services
vpnwall-services / TAR-101.md
Last active Jul 31, 2019
[TAR 101] tar 101 #bash #linux #tar #101
View TAR-101.md

TAR 101

  • Create an archive but exclude a folder tar cvzf myarchive.tar.gz --exclude=exclude/relative/path to_archive_folder/

  • Unarchive .gz gunzip -d archive.gz

  • Unarchive tar.gz

@vpnwall-services
vpnwall-services / bash-array.md
Created Jul 19, 2019
[Bash Array Usage] Bash array usage examples #bash #array #loop #value #usage
View bash-array.md

BASH ARRAY 101

  • To set values in an array testarray=( $(find /this/folder -maxdepth 4 -name 'thisone' -exec dirname {} ';') )

  • To display array echo ${testarray[@]}

  • To loop through array

@vpnwall-services
vpnwall-services / install-graylog.sh
Last active Jul 8, 2019
[Install Graylog] Install graylog #bash #install #graylog
View install-graylog.sh
#!/bin/bash
sudo apt-get install apt-transport-https
wget https://packages.graylog2.org/repo/packages/graylog-3.0-repository_latest.deb
sudo dpkg -i graylog-3.0-repository_latest.deb
sudo apt-get update
sudo apt-get install graylog-server
@vpnwall-services
vpnwall-services / preproder.sh
Created Jul 1, 2019
[PREPRODER] Put a prod platform into preprod #bash #wordpress #preprod #duplicate #quality
View preproder.sh
#!/bin/bash
user=debian
sshoptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
#while read line
for line in $(cat completelist.csv)
do
platform="$(echo $line|cut -d '/' -f 1)"
subplatform="$(echo $line|cut -d '/' -f 2|cut -d ';' -f 1)"
db_name=$(ssh $sshoptions $user@$platform "sudo cat /home/sites/$platform/$subplatform/wp-config.php | grep DB_NAME | cut -d \' -f 4")
db_user=$(ssh $sshoptions $user@$platform "sudo cat /home/sites/$platform/$subplatform/wp-config.php | grep DB_USER | cut -d \' -f 4")
@vpnwall-services
vpnwall-services / rsync-101.md
Created Jul 1, 2019
[RSYNC 101] rsync 101 #rsync #101 #bash
View rsync-101.md

RSYNC 101

  • Rsync with a user that need to sudo to access files on remote rsync -avr --rsync-path="sudo rsync" user@there.local ./
@vpnwall-services
vpnwall-services / NODE-YARN.sh
Last active Jul 2, 2019
[NodeJS & Composer & Yarn Installer] NodeJS & Composer & Yarn Installer #bash #nodejs #node #yarn #composer #installer #dev
View NODE-YARN.sh
#!/bin/bash
#nodejs install
sudo apt-get install curl software-properties-common
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt-get install nodejs
node -v
#composer install
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
@vpnwall-services
vpnwall-services / BULLETPROOFING-101.md
Created Jun 21, 2019
[BULLETPROOFING 101] Protection after pentests #bulletproof #pentest #correct #secure #apache #system #firewall #network
View BULLETPROOFING-101.md

BULLETPROOFING 101

@vpnwall-services
vpnwall-services / DEBUGGING-101.md
Last active Sep 5, 2019
[DEBUGGING 101] DEBUGGING 101 #debugging #101
View DEBUGGING-101.md
  • List all threads of a process ps auxw -T | fgrep apache2

  • Attach strace to those strace -fp $PID

  • Strace all apache2 threads ps awux | grep sbin/apache | awk '{print"-p " $2}' | xargs strace -f^C

You can’t perform that action at this time.