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 | |
# Copyright (C) 2019 by Ben Wei <ben@juluos.org> | |
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, | |
# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF | |
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
###### | |
# sample code of blog | |
## tested with bash 4.3.48 x86_64-pc-linux-gnu ubuntu-16.04.4 LTS |
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
import yaml | |
document = """ | |
a: 1 | |
b: | |
c: 3 |
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 | |
i=1 | |
while [ ! "x$1" = "x" ]; do | |
echo "argv[$i]=[$1]" | |
shift | |
i=$((i + 1)) | |
done |
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 | |
# 2019 Ben Wei <ben@juluos.org> | |
# | |
# This is a example script for CI tests for blog | |
# if not defined in environment variable | |
# you can use the following command to defined it | |
# | |
# export TEST_SSH_HOST="your_ssh_host" |
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
current_mk_abspathname := $(abspath $(lastword $(MAKEFILE_LIST))) | |
current_mk_absdir := $(dir $(current_mk_abspathname)) | |
all: | |
@echo "Makefile absolute pathname: $(current_mk_abspathname)" ; \ | |
echo "Makefile absolute path: $(current_mk_absdir)" |
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
/build$ make -v | |
GNU Make 4.1 | |
Built for x86_64-pc-linux-gnu | |
Copyright (C) 1988-2014 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. | |
/build$ lsb_release -a | |
No LSB modules are available. |
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
~$ python2.7 str_to_hex_for_echo_cmd.py | |
echo -e "testecho_\x21#\x24%\x2a\x5c'\x5c\x22\x21~?<>\x3a| 89920." | |
~$ python3.5 str_to_hex_for_echo_cmd.py | |
echo -e "testecho_\x21#\x24%\x2a\x5c'\x5c\x22\x21~?<>\x3a| 89920." | |
~$ echo -e "testecho_\x21#\x24%\x2a\x5c'\x5c\x22\x21~?<>\x3a| 89920." | |
testecho_!#$%*\'\"!~?<>:| 89920. |
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/sh | |
## if you want to run toplog_per_minute.sh in background | |
## you have to use leading script to put it into backgroud without | |
## issue of "Stopped (tty output)" Error Message of script that | |
## stucked on busybox top command | |
## tested in BusyBox v1.20.2 | |
################################################################## | |
/bin/sh /mnt/nand/toplog_per_minute.sh & |
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/sh | |
IP=$1 | |
if [ "x$IP" = x ]; then | |
echo "syntax: <ServerIP>" | |
exit 1 | |
fi | |
PERIOD=3600 | |
BITS=5M | |
run_batch_iperf() |
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
i=0 ; while [ $i -lt 5 ] ; do iwconfig wlan0 | grep Noise ; sleep 1 ; i=$((i+1)) ; done |