Skip to content

Instantly share code, notes, and snippets.

View aivus's full-sized avatar
🇺🇦

Illia Antypenko aivus

🇺🇦
View GitHub Profile
@bruvv
bruvv / Repair synology BTRFS volume
Created December 6, 2019 18:12
Synology BTRFS repair
btrfs fi show -d
(/dev/mapper/vg1000-lv)
syno_poweroff_task -d
(or: umount /volume1)
(or2: umount /volume1 -f -k)
Check to see if all us unmounted:
df -h
@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:
From -> https://forum.synology.com/enu/viewtopic.php?t=98124
1. Go to your console ( https://console.developers.google.com/ ) and create a project.
2. Create a bucket in Storage -> Cloud Storage -> Storage Browser
3. Go to Storage -> Cloud Storage -> Storage Access and enable Interoperability
4. Generate access key
5. Now go to DSM 5.2 and install Hyper Backup if you havent already.
6. Pick S3 storage
7. The input next to the label "S3 Server" is both text input and drop-down. This is where you write "storage.googleapis.com"
8. Enter key and secret.
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@tomysmile
tomysmile / rpi-configure-locales.md
Last active June 29, 2023 14:37
Raspberry Pi: Reconfigure Locales

Reconfigure your RPi Locales

First you need to install the locales you want:

sudo dpkg-reconfigure locales

Then refresh your current environment:

@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active October 7, 2021 13:57
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@kakawait
kakawait / conf.py
Last active August 4, 2022 09:35
Sphinx only plugin
import sys, os
# The path where you put the only.py file
sys.path.append(os.path.abspath('../sphinx-ext/'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['scope']
@waja
waja / check_ocsp_class1_startssl
Created January 6, 2014 12:26
Check the status of the ocsp responder (here the class1 startssl variant). The -header option (supported by recent openssl versions) is needed for fixing HTTP/1.1, see http://www.math.ucla.edu/~jimc/documents/bugfix/21-openssl-ocsp.html!
#!/bin/sh
wget -q http://www.startssl.com/certs/sub.class1.server.ca.pem -O /tmp/sub.class1.server.ca.pem; \
openssl ocsp -CAfile /tmp/sub.class1.server.ca.pem -issuer /tmp/sub.class1.server.ca.pem \
-url http://ocsp.startssl.com/sub/class1/server/ca -noverify -no_nonce \
-header "HOST" "ocsp.startssl.com" -cert ${1}
@plentz
plentz / nginx.conf
Last active July 2, 2024 13:20
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048