Skip to content

Instantly share code, notes, and snippets.

@goooooouwa
goooooouwa / list-folder-size.sh
Last active July 21, 2025 04:09
show folder size #du #disk-space
du -h --max-depth=1
@goooooouwa
goooooouwa / backup-pg-dump.sql
Last active July 21, 2025 04:06
how to backup & restore a pg dump in postgres docker container #backup #restore #postgres #dump
sudo docker exec -t e564422f1f57 pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
@goooooouwa
goooooouwa / openwrt-how-to-mount-smb-folder
Last active July 21, 2025 04:09
openwrt mount smb folder #openwrt #smb
mount -t cifs -o vers=2.0,username=admin,password=pass,iocharset=utf8 //192.168.50.51/homes /mnt/homes/
import interact from "interactjs";
import React, { useEffect, useState } from "react";
export default function Draggable() {
const [positionX, setPositionX] = useState(0);
// This issue has to do with the following combination:
// - add interactjs event listeners inside useEffect
// - set react useEffect dependency list as []
// - call react setState method inside event listeners
cat $BIN_FILE | tr -d '\0' > $NEW_FILE
xargs -n 1 curl -O -L --retry 5 --retry-max-time 60 -C - < ./mp3-urls-unique-id-fix.txt
@goooooouwa
goooooouwa / common-shell-commands.sh
Last active July 21, 2025 04:08
Common shell commands #bash #find #sed
#!/bin/bash
# bash for loop
for i in $(seq 10 $END); do
echo $i
done
# 1.Iterate over collection
for i in a b c; do
echo $i
@goooooouwa
goooooouwa / build-qtopia.sh
Last active July 21, 2025 04:13
#qt #qtopia #embedded-linux
#!/bin/bash
echo INFO: host: red hat 9.0 with all packages in installation CDs installed.
echo INFO: target: armv4tl Linux 2.6.12-h1940 libc 2.3.2
echo INFO: all operations are executed under root
#build mode
INSTALL_CROSSTOOL=""
COPY_LIBS=""
COMPILE_QT=""
@goooooouwa
goooooouwa / CardDiaryTXT.txt
Last active July 21, 2025 04:16
break CardDiary export txt file into individual diary txt files with date as title. So that I can import these text files into Evernote. #evernote #card-diary
Date: 2018-09-25 16:29:58
Weather: Cloudy
Demo diary post 1
Date: 2018-09-26 19:05:07
Weather: Mostly Cloudy Day
Demo diary post 2
@goooooouwa
goooooouwa / Subscriptions.opml
Last active July 21, 2025 04:16
extract rss feed urls from opml file #rss #opml
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - RSS</title>
</head>
<body>
<outline htmlUrl="http://newworldinteractive.com" title="Blog – New World Interactive" xmlUrl="http://newworldinteractive.com/blog/feed/" type="rss" text="Blog – New World Interactive"/>
<outline htmlUrl="http://www.steampowered.com/" title="New On Steam" xmlUrl="https://store.steampowered.com/feeds/newreleases.xml" type="rss" text="New On Steam"/>
<outline htmlUrl="https://goooooouwa.github.io/" title="Shunfa’s Blog" xmlUrl="https://goooooouwa.github.io/feed.xml" type="rss" text="Shunfa’s Blog"/>
<outline title="test" xmlUrl="tag/test" type="rss" text="test"/>