Skip to content

Instantly share code, notes, and snippets.

View BramDriesen's full-sized avatar
:shipit:
On it!

Bram Driesen BramDriesen

:shipit:
On it!
View GitHub Profile
@BramDriesen
BramDriesen / drupal_thinner.sh
Created November 14, 2023 11:30
A standard Drupal project uses +/-230Mb of disk. Remove tests directories and README* files... The project uses ~30% less space (+/- 160Mb):leaves:! Morality: Save the planet, no more test files on prod!
# Source: https://github.com/MatthieuScarset/drupal-template/blob/10.x/scripts/drupal_thinner.sh
# ######################################################################
# Save the planet, delete your test files!
#
# This script is meant to delete unnecessary files and directories,
# usually Tests and informational content not used on production env.
#
# "Why should I do this? ¯\_(ツ)_/¯" you may ask...
# To reduce your digital footprint by not deploying non-required things
# to the world wide web.
@BramDriesen
BramDriesen / script.sql
Created August 4, 2021 05:54
Remove all images with an hash (Wordpress)
SELECT id, post_title
FROM wp_posts
WHERE post_type = 'attachment'
AND LENGTH(post_title) = 32
AND post_title not like '%.%'
SELECT *
FROM wp_postmeta
WHERE post_id in (
SELECT id
@BramDriesen
BramDriesen / README.md
Created December 18, 2020 14:48 — forked from nwade/README.md
Remove SentinelOne Agent - macOS High Sierra/Mojave

Warning - use at your own risk

Remove SentinelOne agent from Mac

  1. Boot into Recovery Mode by holding Cmd+R during reboot
  2. Open Terminal from top menubar
  3. Run /Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility to open Disk Utility
  4. If your startup disk is encrypted, use Disk Utility to mount it
  5. In Terminal, run chroot /Volumes/Macintosh\ HD
  6. Execute the deletion commands or script
@BramDriesen
BramDriesen / one_line_public_key_copy.bash
Created December 12, 2018 09:40
One line command to copy your public ssh key
cat ~/.ssh/id_rsa.pub | pbcopy
@BramDriesen
BramDriesen / RPI Chromium kiosk 2018.txt
Created November 19, 2018 20:14
RPI Chromium kiosk 2018
# Always keeps on changing =).
https://blog.gordonturner.com/2017/12/10/raspberry-pi-full-screen-browser-raspbian-december-2017/
https://www.raspberrypi.org/forums/viewtopic.php?t=167645
https://raspberrypi.stackexchange.com/questions/42633/raspberry-pi-autostart-of-lxde-does-not-work
@BramDriesen
BramDriesen / delete_git_submodule.md
Created October 15, 2018 15:49 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@BramDriesen
BramDriesen / strings_translations_hook_update_N.php
Created October 4, 2018 15:00 — forked from citlacom/strings_translations_hook_update_N.php
Programmatically set strings translations in hook_update_N()
/**
* Implements hook_update_N().
*/
function hook_update_N(&$sandbox) {
$report = array(
'skips' => 0,
'updates' => 0,
'deletes' => 0,
'additions' => 0
);
sudo apt-get install curl
curl -O https://bin.equinox.io/c/mvjh5YAmwCZ/cryptotrader-stable-linux-amd64.tgz
tar -xvzf cryptotrader-stable-linux-amd64.tgz -C /usr/local/bin/
Siege - Load testing
Jmeter - Load testing
Tree - Building files tree
Truncate - Truncating files
Lnav - Log file navigation
@BramDriesen
BramDriesen / link
Created December 11, 2017 13:18
URL to load the login page of a hotspot in case it doesn't auto-load.