View gpg.sh
martin@martin:~/test$ script=$(curl -s http://localhost:8080/test.sh)
martin@martin:~/test$ sign=$(curl -s http://localhost:8080/test.sh.asc)
martin@martin:~/test$
martin@martin:~/test$ echo "$script"
#!/bin/bash
echo "ok"
martin@martin:~/test$ echo "$sign" | head -n1
-----BEGIN PGP SIGNATURE-----
martin@martin:~/test$
View ansible apt pin.yaml
- copy:
dest: /etc/apt/preferences.d/duplicity
content: |
Package: duplicity
Pin: release v>=0.7.11
Priority: 101
- apt:
name: duplicity
state: latest
View gist:4b2894d008a08999776306b67abc0e42
martin / # cat /tmp/crontest
* * * * * root logger "CRONTEST"
martin / #
martin / # crontab /tmp/crontest
martin / #
martin / # tail -F /var/log/syslog | grep "CRONTEST"
Apr 25 14:33:01 martin CRON[12350]: (root) CMD (root logger "CRONTEST")
Apr 25 14:34:01 martin CRON[12472]: (root) CMD (root logger "CRONTEST")
^C
martin / #
View test.yml
---
- hosts: all
become: yes
remote_user: martin
vars:
ips_a:
- 1.2.3.4
- 4.5.6.7
View gist:bfac625f6cca796ab6cbf7c86ae2e663
martin@martin:~/gpgtest$ cat parametry_klice.txt
Key-Type: RSA
Key-Length: 4096
Subkey-Type: 1
Subkey-Length: 4096
Name-Real: Podepisovani SSH
Name-Email: root@localhost
Expire-Date: 0
martin@martin:~/gpgtest$ $
martin@martin:~/gpgtest$ gpg --batch --gen-key parametry_klice.txt
View here_string.sh
#!/bin/bash
LAN_IP="192.168.1.1"
LAN_MASK="255.255.255.0"
LAN_GW="192.168.1.254"
echo "hello world" | wc -w
wc -w <<< "hello world"
View moded_a6.py
import serial
import os, time
# Enable Serial Communication
port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=1)
# Transmitting AT Commands to the Modem
# '\r\n' indicates the Enter key
port.write('AT'+'\r\n')
View gist:61a7b9a093a551ff943ab9022d74ec38
# cat /etc/nginx/sites-enabled/muj.server.net
server {
listen 80;
listen [::]:80;
index index.html index.htm index.nginx-debian.html;
server_name muj.server.net;
location / {
View gist:4d6c9270bc8891c1540c6e2fa48d4f4c
Je potreba to nechat chvili hrat.
# Alsa:
gcc -xc -oa -<<<'i;g(x,t,o){return(3&x&(i*((3&i>>16?"BY}6YB6%":"Qj}6jQ6%")[t%8]+51)>>o))<<4;}main(n,s){for(;;)putchar(g(1,n=++i>>14,12)+g(s=i>>17,n^i>>13,10)+g(s/3,n+(i>>11)%3,10)+g(s/5,8+n-(i>>10)%3,9));}';./a | aplay
# PulseAudio:
gcc -xc -oa -<<<'i;g(x,t,o){return(3&x&(i*((3&i>>16?"BY}6YB6%":"Qj}6jQ6%")[t%8]+51)>>o))<<4;}main(n,s){for(;;)putchar(g(1,n=++i>>14,12)+g(s=i>>17,n^i>>13,10)+g(s/3,n+(i>>11)%3,10)+g(s/5,8+n-(i>>10)%3,9));}';./a | padsp tee /dev/audio >/dev/null
# Vysledek:
View navod.sh
# Download a rootfs img and a kernel:
sudo apt-get install qemu-user-static qemu-system-arm
wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-armhf-disk1.img
wget http://launchpadlibrarian.net/353613547/linux-image-4.4.0-111-generic-lpae_4.4.0-111.134_armhf.deb
# (https://launchpad.net/ubuntu/xenial/armhf/linux-image-4.4.0-111-generic-lpae/4.4.0-111.134)
dpkg -X linux-image-4.4.0-111-generic-lpae_4.4.0-111.134_armhf.deb .
mkdir -p tmp
qemu-img convert xenial-server-cloudimg-armhf-disk1.img xenial-server-cloudimg-armhf.img
sudo kpartx -av xenial-server-cloudimg-armhf.img
sudo mount /dev/mapper/loop0p1 tmp