- Add sudoer
# Config editor
sudo update-alternatives --config editor
#add user to sudoer
vi /etc/sudoers (visudo)
## Allow root to run any commands anywhere
# Config editor
sudo update-alternatives --config editor
#add user to sudoer
vi /etc/sudoers (visudo)
## Allow root to run any commands anywhere
'''Convert windows path to wsl path''' | |
import sys | |
windows_path = sys.argv[1] | |
MOUNT_PATH = '/mnt' | |
windows_path_split = windows_path.split(':\\') | |
diskLabel, path = windows_path_split[0].lower(), windows_path_split[1].replace('\\', r'''/''').replace(' ', r'''\ ''') | |
wsl_path = '/'.join((MOUNT_PATH, diskLabel, path)) |
def cluster(data, maxgap): | |
'''Arrange data into groups where successive elements | |
differ by no more than *maxgap* | |
>>> cluster([1, 6, 9, 100, 102, 105, 109, 134, 139], maxgap=10) | |
[[1, 6, 9], [100, 102, 105, 109], [134, 139]] | |
>>> cluster([1, 6, 9, 99, 100, 102, 105, 134, 139, 141], maxgap=10) | |
[[1, 6, 9], [99, 100, 102, 105], [134, 139, 141]] |
Add-Type -AssemblyName System.Windows.Forms | |
New-Variable -name INTERVAL -Value (60 * 2) -Option Constant -Description 'for 5mins lock default' | |
get-date | |
echo `start` | |
while ($true) { | |
$key = '{SCROLLLOCK}' | |
get-date | |
echo "press key $key`n" | |
try { | |
[System.Windows.Forms.SendKeys]::SendWait($key) |
#!/bin/bash | |
TARGET_SERVICE=server_status_web | |
service_start_cmd='/home/pi/run/server_statisic/FlaskApp/server_status_web.py' | |
usage(){ | |
echo -e "Usage: bash $0 [ start | stop | restart ] " | |
exit 1 | |
} | |
start_service(){ |
import gc | |
import machine | |
# import machine | |
import time | |
import network | |
SSID='Poop' | |
PWD='cockcock' | |
# Configure GPIO pins 0 and 2 to be used for |
libnfc supports UUID writable cards and even has some dedicated tools for them.
However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.
Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.
The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):
// Try to write the trailer
for %%F in (*.zip) do ( "C:\Program Files\7-Zip\7z.exe" x -y -o"%%F_tmp" "%%F" * & pushd %%F_tmp & "C:\Program Files\7-Zip\7z.exe" a -y -r -t7z ..\"%%~nF".7z * & popd & rmdir /s /q "%%F_tmp" ) |
#!/bin/bash | |
#filename seerver_moniter.sh | |
mem_quota=20 | |
hd_quota=50 | |
cpu_quota=80 | |
# watch memory usage | |
watch_mem() |
#!/bin/bash | |
TIMESTAMP=$(date +%F) | |
ssh -i /home/pi/.ssh/id_rsa_3072 root@192.168.31.240 <<'ENDSSH' | |
#commands to run on remote host | |
rm reaver_backup_*.zip; | |
zip -r ~/reaver_backup_`date +"%Y%m%d"`.zip /usr/local/etc/reaver; | |
scp -i /root/.ssh/id_rsa_3072 ~/reaver_backup*.zip pi@192.168.31.179:~/; | |
exit |