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
<?php | |
$fp = fopen('power.log', 'a+'); | |
$oldPower = 0; | |
while (true) { | |
$power = (int)`pmset -g batt | awk ' /InternalBattery-0/ { print $3 }'`; | |
if ($oldPower != $power) { | |
$oldPower = $power; | |
fputcsv($fp, [date('c'), time(), $power]); |
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
package flink; | |
import org.apache.flink.streaming.api.datastream.DataStream; | |
import org.apache.flink.streaming.api.datastream.DataStreamSource; | |
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; | |
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction; | |
import org.apache.flink.streaming.api.functions.source.SourceFunction; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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
[3e26f1ec41a7:21000] > create table test(a int, b int, c int); | |
Query: create table test(a int, b int, c int) | |
Fetched 0 row(s) in 0.07s | |
[3e26f1ec41a7:21000] > insert into test values (1,2,3); | |
Query: insert into test values (1,2,3) | |
Query submitted at: 2018-03-14 15:01:11 (Coordinator: http://3e26f1ec41a7:25000) | |
select * from test; |
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
3e26f1ec41a7:21000] > create table test (a int, b int); | |
Query: create table test (a int, b int) | |
Fetched 0 row(s) in 0.77s | |
[3e26f1ec41a7:21000] > insert into test values (1,2), (3,4); | |
Query: insert into test values (1,2), (3,4) | |
Query submitted at: 2018-03-14 14:57:06 (Coordinator: http://3e26f1ec41a7:25000) | |
select * from test; | |
Query progress can be monitored at: http://3e26f1ec41a7:25000/query_plan?query_id=8f483cc1be99748d:be8e17e500000000 | |
Modified 2 row(s) in 6.64s |
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
<?php | |
$dict = json_decode(file_get_contents('/Users/Sirko/Library/Application Support/plover/main.json'), true); | |
$dictKeys = array_keys($dict); | |
$inputText = strtolower('this is the first input text'); | |
echo($inputText."\n"); | |
$inputTextWords = explode(' ', $inputText); |
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
public class InjectLoggerTest { | |
@InjectLogger | |
private Logger logger; | |
public static void main(String[] args) throws Exception { | |
final Injector injector = Guice.createInjector(new ModuleInjectLogger()); | |
final InjectLoggerTest injectLoggerTest = injector.getInstance(InjectLoggerTest.class); | |
injectLoggerTest.f(); |
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
# start a stream on raspberry pi | |
raspivid -o - -t 0 -hf -w 640 -h 360 -fps 25 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream}' :demux=h264 | |
# save raspberry pi camera stream | |
ffmpeg -i rtsp://@192.168.0.206:8554/stream -an -c:v libx264 output.mp4 | |
# another version that seems to work - but very slow: | |
raspivid -o - -t 99999 | cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264 |
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
import java.util.Random; | |
public class MontyHallSimulation { | |
public static void main(String[] args) { | |
new MontyHallSimulation().start(); | |
} | |
private Random rand = new Random(4); | |
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
# curl https://gist.githubusercontent.com/.../startopenssh.sh | bash | |
wget https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz | |
tar -xvzf docker-latest.tgz | |
mv docker/* /usr/bin/ | |
nohup dockerd & | |
OVPN_DATA="ovpn-data" | |
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://$(ifconfig | grep -A 5 eth0 | awk -F':' '/inet addr/&&!/127.0.0.1/{split($2,_," ");print _[1]}') | |
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn sh -c 'echo -e "yes\nblep\n" | ovpn_initpki nopass' | |
docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn | |
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full thecert nopass |
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
// ==UserScript== | |
// @name Slither.io Mods | |
// @namespace DerpCookiePrograms | |
// @version 0.1 | |
// @description Sliter.io Mods | |
// @author DerpCookiePrograms | |
// @match http://slither.io/* | |
// @grant none | |
// ==/UserScript== |
NewerOlder