Skip to content

Instantly share code, notes, and snippets.

#
# Only can use for local file system synchronisation.
#
# Usage:
# $ ruby joplin_clean_up_resources.rb /path/to/synchronise/directory
#
path = ARGV[0].chomp("/")
resources = `ls #{path}/.resource`
resources.split.each do |resource|
@heartnn
heartnn / synology_disk_benchmark.sh
Created January 8, 2020 14:08 — forked from gxfxyz/synology_disk_benchmark.sh
A simple script to test Synology NAS disk speed with hdparm, dd and fio
#!/usr/bin/env bash
# =======================================================================================
#
# A simple script to test Synology NAS disk speed with hdparm, dd and fio.
#
# How to use:
#
# 1. Save synology_disk_benchmark.sh and xfio.conf to your Synology NAS
# 2. Make it executable: chmod +x synology_disk_benchmark.sh
@heartnn
heartnn / another_way.md
Last active March 6, 2024 13:24
How to properly do a filesystem check (fsck or e2fck) on Synology DSM 6.0 e.g. DS414

syno_poweroff_task -d

umount /volume1 (replace this with your volume name)

fsck.ext4 -pvf /dev/md0 (replace this with your dev)

reboot the system after the scan is completed


via:

@heartnn
heartnn / install_start_stop_daemon.sh
Created December 19, 2019 12:41 — forked from yuuichi-fujioka/install_start_stop_daemon.sh
install start-stop-daemon to centos, fedora, redhat.
#!/bin/bash
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin/
@heartnn
heartnn / best.txt
Last active December 15, 2023 02:32
DNS for speedup Nintendo Switch (Chinese User)
112.106.53.22 cache01-kcn.ic
112.106.53.34 cache04-kcn.ic
121.202.130.66 m121-202-130-66.smartone.com
203.225.255.10 whcc.kolon.co.kr
203.225.255.11
211.111.172.71 a01.kuwoo.co.kr
211.111.172.72 a02.kuwoo.co.kr
219.84.192.250 219-84-192-250.STATIC.so-net.net.tw
#!/bin/bash
that_ip=192.168.31.1
server_ip=10.10.16.27
my_ip=$(ip -f inet address show ens33| grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/24'| grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
echo that_ip=$that_ip
echo server_ip=$server_ip
echo my_ip=$my_ip
@heartnn
heartnn / How to install tcpping on Linux.md
Last active November 7, 2019 12:52 — forked from cnDelbert/How to install tcpping on Linux.md
How to install tcpping on Linux

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute bc

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute bc
@heartnn
heartnn / install_jenkins_plugin.sh
Created January 7, 2019 00:44 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@heartnn
heartnn / arch.md
Created September 22, 2018 05:07 — forked from onlurking/arch.md
Arch Linux chroot on Termux

Arch Linux

chroot on Termux

Let's download the Arch ARM image with the text-browser w3m and install proot:

apt install w3m proot
w3m http://archlinuxarm.org/os/ArchLinuxARM-utilite-latest.tar.gz
@heartnn
heartnn / Install-Archlinux-in-Linux-Deploy-with-ssh-fix-and-working-aur.md
Created September 22, 2018 05:06 — forked from imShara/Install-Archlinux-in-Linux-Deploy-with-ssh-fix-and-working-aur.md
Установка Archlinux в LinuxDeploy с фиксом ssh и рабочим aur

Установка Archlinux в LinuxDeploy с фиксом ssh и рабочим aur

Устанавливаем в LinuxDeploy

Как обычно ¯_(ツ)_/¯

Фиксим SSH — extra/ssh fail (sshd segmentation fault)

В настройках LinuxDeploy активируем Telnet Подключаемся к telnet серверу LinuxDeploy

$ telnet localhost 5023