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/perl | |
$iport = int(rand(40000)) + 10000; | |
$first = 1; | |
foreach (@ARGV) { | |
if (/^--port=/) { | |
$args = "$_"; | |
$args =~ /port=([0-9]+)?/; | |
$iport = int($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
#!/bin/bash | |
echo "Waiting for the UART..." | |
while true; do | |
SERIAL="$(ls /dev/tty* | grep usbserial)" | |
if [ -n "$SERIAL" ]; then | |
screen "$SERIAL" 115200 | |
fi | |
sleep 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Yoba</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
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
for f in *.db; do sqlite3 $f "VACUUM; REINDEX;"; 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 | |
################################# | |
str="Привет, наркомания" | |
################################# | |
# Карта цветов | |
len=`echo $str | wc -c` |
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
from gi.repository import GLib, Gio, GObject | |
import time | |
def slow_stuff(job, cancellable, user_data): | |
print "Slow!" | |
for i in xrange(5): | |
print "doing slow stuff..." | |
time.sleep(0.5) | |
print "finished doing slow stuff!" | |
return False # job completed |
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
# Private Bash Profile | |
# Can be used for other settings you don’t want to commit | |
echo "" | |
echo "$YELLOW Hostname$NOCOLOR: $WHITE`hostname`$NOCOLOR" | |
echo "$YELLOW Inet IP$NOCOLOR: $WHITE`ip`$NOCOLOR" | |
echo "$YELLOW Local IP$NOCOLOR: $WHITE`localip`$NOCOLOR" | |
echo "$YELLOW Uptime$NOCOLOR: $WHITE`uptime | awk -F 'up ' '{ print $2 }' | awk -F ',' '{ print $1 }'`$NOCOLOR" | |
echo "$YELLOW SSD usage$NOCOLOR: $WHITE`df / | awk '{print $5}' | grep "%"`$NOCOLOR" | |
echo "$YELLOW HDD usage$NOCOLOR: $WHITE`df /Volumes/HDD | awk '{print $5}' | grep "%"`$NOCOLOR" |
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 | |
if echo "$1" | grep ":" > /dev/null; then | |
srv="`echo \"$1\" | awk -F\: '{ print \$1}'`" | |
pth="`echo \"$1\" | awk -F\: '{ print \$2}'`" | |
cmd="cd $pth;" | |
else | |
srv="$1" | |
fi | |
cmd="$cmd cat | bash" | |
cat $2 | ssh "$srv" "$cmd" |