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 | |
# NAME: clone-ubuntu.sh | |
# PATH: /usr/local/bin | |
# DESC: Written for AU Q&A: https://askubuntu.com/questions/1028604/bash-seemless-safe-script-to-upgrade-16-04-to-18-04/1028605#1028605 | |
# DATE: Apr 27, 2018. Modified May 6, 2018. | |
# UPDT: May 02 2018 - Display selected parition and get confirmation. | |
# May 06 2018 - Revise `do-release-upgrade -d` instructions. | |
# Correct listing of files in empty target partition. |
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 | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
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 | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
NAME=app | |
DIR=/home/username/app/bin | |
PIDFILE=/var/run/$NAME.pid | |
DAEMON=/home/username/app/bin/executable | |
DAEMON_ARGS="-foo bar" |
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
# http://eleparts.co.kr/data/design/product_file/SENSOR/gas/MH-Z19_CO2%20Manual%20V2.pdf | |
# http://qiita.com/UedaTakeyuki/items/c5226960a7328155635f | |
import serial | |
import time | |
def mh_z19(): | |
ser = serial.Serial('/dev/ttyAMA0', | |
baudrate=9600, | |
bytesize=serial.EIGHTBITS, | |
parity=serial.PARITY_NONE, |
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 | |
jtl="file.jtl" | |
total=$(wc -l < $jtl) | |
let "total -= 1" | |
for i in $(cut -f 4 -d , $jtl | sort | uniq | egrep "[0-9]") | |
do | |
count=$(cut -f 4 -d , $jtl | grep $i | wc -l) | |
rate=$(echo "scale=2; 100 * $count / $total" | bc) |
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 groovy.transform.EqualsAndHashCode | |
@EqualsAndHashCode(includeFields=true) | |
public class Person { | |
String name; | |
String lastName; | |
@Delegate |
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 java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Person { | |
private String name; | |
private String lastName; |
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
class WorkingDay { | |
def schedule = [] | |
WorkingDay() { | |
def mc = new ExpandoMetaClass(WorkingDay, false, true) | |
mc.initialize() | |
this.metaClass = mc | |
} |