Skip to content

Instantly share code, notes, and snippets.

@uryossa
uryossa / bash-script-easy-log.sh
Created September 3, 2021 10:17
bash script log to file and stdout
#!/bin/bash
LOGFILE=/path/to/logfile
{
command 1
command 2
} 2>&1 | tee >(awk '{print strftime("%Y/%m/%d %H:%M:%S "),$0 } { fflush() }' >>$LOGFILE)
@uryossa
uryossa / dhs-update.sh
Created June 2, 2020 02:40
Update IP Dynamic DNS dhs.org
#!/bin/bash
RETVAL=0
USER=username
PASSWORD=password
HOSTNAME=hostname
DOMAIN=dyn.dhs.org
CHECKIPURL=http://checkip.dyndns.org:8245/
WANIPNEWCACHE=/var/tmp/wanip-cache-new
@uryossa
uryossa / gist:dcf94d3c937e7d8ba86e3b7f5d508f9b
Last active November 27, 2017 08:40
homebrew curlftpfs with newer libcurl
brew install curlftpfs
vim /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/curlftpfs.rb
————————————————————————————————————————————————————————————————————————————————
depends_on "curl" => :build
————————————————————————————————————————————————————————————————————————————————
ENV.append "CPPFLAGS", "-D__off_t=off_t -I/usr/local/opt/curl/include"
ENV.append "LDFLAGS", "-L/usr/local/opt/curl/lib"
――――――――――――――――————————————————————————————————————————————————————————————————
@uryossa
uryossa / libiconv-1.15_UTF-8-MAC-failed
Created April 20, 2017 05:04
failed at CentOS7 mmh....
diff -uNr libiconv-1.15.orig/Makefile.devel libiconv-1.15/Makefile.devel
--- libiconv-1.15.orig/Makefile.devel 2017-01-02 08:00:24.000000000 +0900
+++ libiconv-1.15/Makefile.devel 2017-04-19 12:32:26.205973841 +0900
@@ -4,10 +4,10 @@
SHELL = /bin/sh
MAKE = make
-AUTOCONF = autoconf-2.69
-AUTOHEADER = autoheader-2.69
-AUTOMAKE = automake-1.15