Skip to content

Instantly share code, notes, and snippets.

@lexaone
lexaone / gen4.sh
Last active September 28, 2020 13:26
#!/bin/bash
#export FROM="R1-U20-P11B"
#export TO="R2-U21-P12B"
#blabel-print --printer=GenericPT-2430PC --file=
#export L_PRINTER=GenericPT-2430PC
#export L_PRINTER=GenericPT-2430PC-2
export L_PRINTER="PT-P750W --p700 --all2one"
export IM_TEMPLATE1="
stroke none
#!/usr/bin/perl
# B-Label's stand-alone printing part
# B-Label (C) 2011-2020 by Ari Sovijärvi <ari.sovijarvi@cleverbit.fi>
# Released under Perl artistic license.
use constant VERSION=>"v1.03 build 28";
use constant VERSIONDATE=>"2020-04-23";
use GD;
use Net::CUPS;
#!/bin/bash
cp ~/.ssh/known_hosts ~/.ssh/known_hosts.bak
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18;do
ssh-keygen -R 192.168.1.${i}
done
for i in 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118;do
ssh-keygen -R 192.168.1.${i}
done
#!/bin/bash
export PORT=8000
echo "############## STARTING HTTP SERVER on PORT ${PORT}"
echo "############## here are files in this directory to access:"
ls -1
echo "############## adresses to conect:"
ip -br -4 ad sh|grep UP
#python -m SimpleHTTPServer 8000
python3 -m http.server ${PORT}
@lexaone
lexaone / wget2aria.sh
Last active September 30, 2020 07:50
cat wget.sh |sed 's/WGET=\/usr\/bin\/wget/WGET=\/usr\/bin\/wget/;s/.* --load-coo/$ARIA --load-coo/;s/-O \"\$OUT/-o "$OUT/;/WGET=\/usr\/bin/a \
ARIA="aria2c -j 4 -x 4 --summary-interval=20"
'>wget2.sh
#!/bin/bash
rsync -e 'ssh -p 2222' -zcavP --no-owner --no-group --no-perms --progress --delete ~/Dropbox/Books/*fb2.zip root@192.168.0.34:/mnt/onboard/.BOOKS/
@lexaone
lexaone / a.pl
Last active October 7, 2020 06:52
#!/usr/bin/perl
use Lingua::Translit;
#my $str = 'Новая статья про транслит.';
my $str=$ARGV[0];
print "mv \"$str\" ";
my $tr = new Lingua::Translit("GOST 7.79 RUS");
my $result;
if ($tr->can_reverse()) {
$result = $tr->translit($str);
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
######################################################################
# thinkfan 0.7 example config file
# ================================
#
# ATTENTION: There is only very basic sanity checking on the configuration.
# That means you can set your temperature limits as insane as you like. You
# can do anything stupid, e.g. turn off your fan when your CPU reaches 70°C.
#
# That's why this program is called THINKfan: You gotta think for yourself.
#
@lexaone
lexaone / zig shell trick
Last active September 9, 2021 17:47
zig shell trick
//usr/bin/env zig run $0 $@ ; exit
const std = @import("std");
pub fn main() !void {
std.log.info("Awesome, it works\n", .{});
}