Skip to content

Instantly share code, notes, and snippets.

View ciberjohn's full-sized avatar
🤔
Thinking why I didn't learn to code when I was younger

Ciberjohn ciberjohn

🤔
Thinking why I didn't learn to code when I was younger
View GitHub Profile
@maxme
maxme / raspberry-power-supply-check.sh
Last active August 5, 2023 06:45
Check your Raspberry pi power supply and USB cable
#!/bin/bash
# Before running this script, make sure you have sysbench installed:
# sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here: https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
# If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 25, 2025 07:14
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 27, 2025 07:06
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@archerslaw
archerslaw / Simple virsh commands.
Last active August 17, 2022 13:38
Simple virsh commands.
# /bin/systemctl restart libvirtd.service
# /bin/systemctl enable libvirtd.service
Note:
How to turn on the debug logs for libvirtd.
1)open /etc/libvirt/libvirtd.conf in your favourite editor.
2)find & replace, or set these variables:
log_level = 1
log_filters="3:remote 4:event 3:json 3:rpc" | log_filters="1:qemu_monitor_json"
log_outputs="1:file:/var/log/libvirt/libvirtd.log"
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory