sudo nano /boot/cmdline.txt
and changeconsole=tty1
toconsole=tty2
sudo nano /etc/rc.local
and add/home/pi/autostart.sh &
cd
touch autostart.sh
chmod a+x autostart.sh
nano autostart.sh
#!/usr/bin/env bash | |
# | |
# translates any selection and displays the result in a notification. | |
# Install: | |
# - sudo apt install libnotify-bin xsel jq | |
# - you can copy this file to ~/bin, /usr/local/bin or somewhere and make it executable | |
# - configure a hotkey to execute it. You can use xbindkeys or your DE settings | |
in=$(xsel -o | sed "s/[\"'<>]//g") | |
notify-send --icon=info "$in" "$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=$in" |jq -r '.[0][0:]|.[]|.[1]')" |
#!/usr/bin/env bash | |
DEV=`dbus-send --print-reply --dest=org.kde.kdeconnectd /modules/kdeconnect/devices org.freedesktop.DBus.Introspectable.Introspect | sed -n 's/.*node name="\(.*\)".*/\1/p'` | |
DATE=`date +'%d-%m-%Y'` | |
SMS="`dbus-send --print-reply --dest=org.kde.kdeconnectd /modules/kdeconnect/devices/$DEV org.kde.kdeconnect.device.conversations.activeConversations | grep -A3 "Operace ze dne $DATE" | sed 's/.*string "\|"$//'`" | |
echo $SMS | |
CODE=`echo $SMS | sed -ne 's/.* \([0-9]\{5,\}\) .*/\1/gp'` |
sudo nano /boot/cmdline.txt
and change console=tty1
to console=tty2
sudo nano /etc/rc.local
and add /home/pi/autostart.sh &
cd
touch autostart.sh
chmod a+x autostart.sh
nano autostart.sh
#include <SoftwareSerial.h> | |
#include "DMXUSB.h" | |
#include <FastLED.h> | |
SoftwareSerial mySerial(10, 11); // RX, TX | |
#define LED_PIN LED_BUILTIN | |
#define DMXUSB_BAUDRATE 115200 | |
#define NUM_LEDS 16 |
# separate pdf pages | |
convert -density 400 doc.pdf page-%0d.jpg | |
# use gimp to insert the signature at the right place at the right page, remove unnecessary pages etc | |
# scan | |
for F in page*jpg; do | |
convert -resize 1800x1800 -density 95 -flatten "$F" -rotate "0.$(( ( RANDOM % 2 ) + 3 ))" +repage -attenuate "0.$(( ( RANDOM % 8 ) + 20 ))" +noise Gaussian -quality 85 -compress JPEG -colorspace gray "$F-scanned.jpg" | |
done |
# downloads a page from gemini server | |
(echo "gemini://gemini.circumlunar.space/docs/"; sleep 1) | openssl s_client -connect gemini.circumlunar.space:1965 |
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |