README
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for mac. | |
SEGMENT="192.168.1." | |
for i in `seq 1 255`; do | |
RET=`ping -c 1 -W 1000 ${SEGMENT}${i}` | |
echo "${RET}" | grep '100.0% packet loss' > /dev/null | |
if [ $? -eq 1 ]; then | |
echo "found,${SEGMENT}${i}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"posts": [ | |
{{ $list := .Data.Pages -}} | |
{{ $len := (len $list) -}} | |
{{ if lt 0 $len -}} | |
{{ range first 1 $list -}} | |
{ | |
"id" : {{ .Date.Format "20060102150405" | jsonify }}, | |
"date" : {{ if .Date }}{{ .Date.Format "2006.01.02" | jsonify }}{{else}}""{{end}}, | |
"title" : {{ .Title | jsonify }}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"posts": [ | |
{ | |
"id" : "20171004010101", | |
"date" : "2017.10.04", | |
"title" : "Post4", | |
"summary" : "etc4 etc4\u0026hellip;", | |
"body" : "\u003cp\u003eetc4 etc4\u0026hellip;\u003c/p\u003e\n", | |
"tags" : [], | |
"some-ex-param" : "test4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baseURL = "http://example.org/" | |
languageCode = "en-us" | |
title = "My New Hugo Site" | |
[outputs] | |
section = ["JSON", "HTML"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git checkout -b for_wip | |
git commit --allow-empty -m "wip" | |
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- update sequence by last_value | |
SELECT setval('some_table_seq', (SELECT last_value FROM some_table_seq)+1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Required: macOS 10.14.5 | |
# copy local to remote | |
$ scp -i ~/.ssh/id_rsa -r /home/localuser/local_dir sshuser@<ip>:/home/remoteuser/dir_placed_local_dir/ | |
# copy remote to local | |
$ scp -i ~/.ssh/id_rsa -r sshuser@<ip>:/home/remoteuser/remote_dir /home/localuser/dir_placed_remote_dir/ |
OlderNewer