Skip to content

Instantly share code, notes, and snippets.

View mckabue's full-sized avatar

Kabui Charles mckabue

View GitHub Profile
@mckabue
mckabue / HeidiDecode.js
Created May 31, 2018 21:17 — forked from jpatters/HeidiDecode.js
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@mckabue
mckabue / visor-archivos-online.md
Created June 8, 2018 15:11 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@mckabue
mckabue / reconfigure-virtualbox-dkms
Created September 6, 2018 08:33 — forked from kakoma/reconfigure-virtualbox-dkms
Reconfigure Ubuntu's virtualbox-DKMS after a kernel upgrade
#!/bin/bash
# Description: Everytime the Kernel is upgraded (which is quite often), virtualbox stops working and throws the following error:
#
# The provider 'virtualbox' that was requested to back the machine
# 'default' is reporting that it isn't usable on this system. The
# reason is shown below:
#
# VirtualBox is complaining that the installation is incomplete. Please
# run `VBoxManage --version` to see the error message which should contain
# instructions on how to fix this error.
@mckabue
mckabue / JSON_to_URLEncoded.js
Created September 29, 2018 18:39 — forked from lastguest/JSON_to_URLEncoded.js
Convert JavaScript object to x-www-form-urlencoded format
function JSON_to_URLEncoded(element,key,list){
var list = list || [];
if(typeof(element)=='object'){
for (var idx in element)
JSON_to_URLEncoded(element[idx],key?key+'['+idx+']':idx,list);
} else {
list.push(key+'='+encodeURIComponent(element));
}
return list.join('&');
}
@mckabue
mckabue / clearRAM.sh
Created January 14, 2019 08:07 — forked from pklaus/clearRAM.sh
A Script to Clear Cached RAM on Linux
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi
@mckabue
mckabue / flush-dns.sh
Created March 27, 2019 05:09 — forked from craigvantonder/flush-dns.sh
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# NB: First install nscd with sudo apt-get install nscd
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
@mckabue
mckabue / adb+
Created January 30, 2020 15:13 — forked from christopherperry/adb+
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@mckabue
mckabue / cloudflare-delete-all-records.sh
Created May 22, 2020 19:51 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
[email protected]
KEY=11111111111111111111111111
ZONE_ID=2222222222222222222222222
curl -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "X-Auth-Email: ${EMAIL}" \
-H "X-Auth-Key: ${KEY}" \
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (

How to turn off Webpack code-splitting

Using Webpack import()

The following code will produce code-splitting in Webpack, which means that the source code will be split into several files that will be loaded async at runtime.. More info here;

import('./some-module').then((SomeModule) => {});
@mckabue
mckabue / apache-permission.sh
Last active July 13, 2020 10:51 — forked from v1shwa/apache-permission.sh
Ubuntu: Fix for Permissions denied on /var/www/html
# 1. Change owner of /var/www/html directory to apache user, here: www-data.
sudo chown -R www-data:www-data /var/www/html
# 2. Allow Group to edit.
sudo chmod -R 775 /var/www/html
# 3. Add yourself to apache group(www-data).
sudo usermod -a -G www-data ${USER}
# 4. Reboot to effect the permissions.