This file contains hidden or 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
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: (Starting|Started) Session [[:digit:]]+ of user [^[:space:]]+\.$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: (Reexecuting|Reloading)\.$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: systemd [[:digit:]]+ running in system mode. \((\+[[:alnum:]]+ ?)+\)$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: Expecting device [^[:space:]]+\.device\.\.\.$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: Start(ing|ed) Cleanup of Temporary Directories\.+$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: Start(ing|ed) Run anacron jobs\.+$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd-logind\[[[:digit:]]+\]: New session [[:digit:]]+ of user [^[:space:]]+\.$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd-logind\[[[:digit:]]+\]: Removed session [[:digit:]]+\.$ | |
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ systemd\[[[:digit:]]+\]: (Stopping|Stopped target|Reached target) |
This file contains hidden or 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
def speakthings a,b,op | |
%x{echo "#{a} #{op} #{b}" | espeak --stdin} | |
end | |
def singleop a,b,op,r | |
begin | |
puts " #{a}" | |
puts " #{op}" | |
puts " #{b}" | |
speakthings a,b,op |
This file contains hidden or 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 | |
mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vo png:outdir=/out/dir/temp -flip -frames 40 | |
name=$(date +%Y-%m-%d) | |
mv /out/dir/temp/00000040.png /out/dir/$name.png | |
rm /out/dir/temp/000000*.png |
This file contains hidden or 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
require 'date' | |
require 'colorize' | |
# Parse glassfish default log files | |
# "X.X.X.X" "NULL-AUTH-USER" "22/Jul/2013:09:39:33 +0000" "POST /url/address/id HTTP/1.1" 200 7 | |
# group things inside "" (?<=")(.*?)(?=") | |
# group things inside whitespaces (?<=\s)(.*?)(?=\s) | |
# last two digits parser | |
class LogLine |
This file contains hidden or 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
final Pattern IP_PATTERN = Pattern.compile("\\A(\\d{1,3})[.](\\d{1,3})[.](\\d{1,3})[.](\\d{1,3})\z"); | |
private boolean ipAddressValidator(String iPaddress){ | |
Matcher m = IP_PATTERN.matcher(iPaddress); | |
boolean matches = m.matches(); | |
boolean validIp = false; | |
int[] octects = extractIpOctets(iPaddress); | |
for(int octet: octects){ | |
if (octet > 255){ | |
validIp = false; | |
break; |
This file contains hidden or 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
require "net/https" | |
require "uri" | |
def check_rf(sitid) | |
magic_number = 1040187392+sitid.to_i | |
uri = URI.parse("https://sap2.astra2connect.com/tms/term/4-#{magic_number}/cgi-bin/modem_status") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
begin |
This file contains hidden or 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
require "rubygems" | |
require "twitter" | |
tweet_f = Twitter.user_timeline("INGVterremoti").first.text | |
elements = tweet_f.split(/Ml:(\d.\d) (\d{4}-\d{2}-\d{2} \d{1,2}:\d{1,2}:\d{1,2}) UTC Lat=(\d{1,2}.\d{1,2}) Lon=(\d{1,2}.\d{1,2}) Prof=(\d{1,3}.\d{1,3})Km Prov=(\D*)/) | |
f_tstamp = elements[2] | |
while(true) | |
sleep(60*5) | |
tweet_s = Twitter.user_timeline("INGVterremoti").first.text | |
elements = tweet_s.split(/Ml:(\d.\d) (\d{4}-\d{2}-\d{2} \d{1,2}:\d{1,2}:\d{1,2}) UTC Lat=(\d{1,2}.\d{1,2}) Lon=(\d{1,2}.\d{1,2}) Prof=(\d{1,3}.\d{1,3})Km Prov=(\D*)/) | |
s_tstamp = elements[2] |