Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
location=<your backup location>
date=`date "+%Y%m%d"`
for name in $(docker ps --format '{{.Names}}'); do
#Backup location per container
backup_location=$location"/"$name
#Make the directory when it doesn't exist
@kroko23
kroko23 / synology speed tweaks.md
Created December 23, 2020 00:40 — forked from bruvv/synology speed tweaks.md
synology speed tweaks

Got and ssh into your box. Find what is using swap:

find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" -v TOTSWP="$(cat /proc/swaps | sed 1d | awk 'BEGIN{sum=0} {sum=sum+$(NF-2)} END{print sum}')" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") {used_swap=process["VmSwap"];sub(/[ a-zA-Z]+/,"",used_swap);percent=(used_swap/TOTSWP*100); printf "%10s %-30s %20s %6.2f%\n",process["Pid"],process["Name"],process["VmSwap"],percent} }' '{}' \;  | awk '{print $(NF-2),$0}' | sort -hr | head | cut -d " " -f2-

Update synoinfo.conf to correct memory in MB (https://www.gbmb.org/gb-to-mb) for 8GB:

/etc/synoinfo.conf & /etc.defaults/synoinfo.conf
mem_default_mb="8192"
@kroko23
kroko23 / Repair synology BTRFS volume
Created December 23, 2020 00:39 — forked from bruvv/Repair synology BTRFS volume
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
@kroko23
kroko23 / camera.md
Created October 2, 2016 13:03 — forked from gabonator/camera.md
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@kroko23
kroko23 / password.txt
Created October 2, 2016 13:02 — forked from gabonator/password.txt
HiSilicon IP camera root passwords
Login Password
root xmhdipc
root klv123
root xc3511
root 123456
root jvbzd
default OxhlwSG8
defaul tlJwpbo6
defaul S2fGqNFs
root hi3518
@kroko23
kroko23 / find_open_resolvers.pl
Created December 17, 2015 07:59 — forked from bitfolk/find_open_resolvers.pl
Quick bit of perl code to scan an IP range for open DNS resolvers. I use it to check for misconfigured customer resolvers on my network, so that I can hopefully open a ticket with the customer before they get used as a DDoS multiplier.
#!/usr/bin/perl
use warnings;
use strict;
use Net::IP;
use Net::DNS;
use IO::Select;
use Getopt::Long;
use Pod::Usage;