Skip to content

Instantly share code, notes, and snippets.

@luhaoming
luhaoming / 7zback.sh
Created December 25, 2017 06:38
full and diff backup with 7zip at linux
#!/bin/bash
# daily backup
# last update 2017-12-25
#
function usage {
echo "$1 not set"
echo "usage: "
echo "7zback <BackToPath> <Bac
@luhaoming
luhaoming / pchome.cmd
Last active December 4, 2017 02:21
daily download pchome by bitsadmin
:: @echo off
:: daily download pchome by bitsadmin
set /a dt=%date:~0,4%%date:~5,2%%date:~8,2%
set pchome=http://24h.pchome.com.tw/onsale/v3/%dt%/#!3c.htm
bitsadmin.exe /transfer "download" %pchome% d:\local\downloads\pchome.html
@luhaoming
luhaoming / withBig5.php
Created October 18, 2017 03:17
check the string contains big5 charactor
function withBig5($arg_strContent)
{
$blnEnglishOnly= true;
$intLoopCount = 0;
$intContentLength = strlen($arg_strContent);
while ($intLoopCount < $intContentLength)
{
$chrSingle = substr($arg_strContent,$intLoopCount,1);
if(ord($chrSingle) > 0x80)
{
@luhaoming
luhaoming / bootnotice.cmd
Created October 18, 2017 01:51
bootnotice at windows
@echo off
::boot notice
:: change these setting
set uid=yourname@gmail.com
set upw=yourpass
set from=yourname@gmail.com
set to=yourname@gmail.com
set title="Boot Notice"
set emailclient="D:\tasks\sendEmail.exe"
@luhaoming
luhaoming / rm_container.cmd
Created October 18, 2017 01:48
remove all container in windows docker
for /f %i in ('@docker ps -a -q') do docker rm %i
@luhaoming
luhaoming / rm_container.cmd
Last active January 18, 2018 01:56
measure windows commnad execution time
for /f %i in ('@docker ps -a -q') do docker rm %i