- Open putty
- Set host name:
hostname.onedumb.com
, port:203
- In category, go to Connection->SSH->Tunnels, set Source port:
1433
, Destination:sqlhost:1433
- Click Add button
- Click open, login as:
pi
password:1qazxsw2
- It should be connected to the server, keep it in hte background
- Open SQLServer client
- Servername:
127.0.0.1
- Login:
SA
- Password:
passWORD
- Add sudoer
# Config editor
sudo update-alternatives --config editor
#add user to sudoer
vi /etc/sudoers (visudo)
## Allow root to run any commands anywhere
This file contains hidden or 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
'''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)) |
This file contains hidden or 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
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]] |
This file contains hidden or 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
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) |
This file contains hidden or 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 | |
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(){ |
This file contains hidden or 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
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
This file contains hidden or 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 (*.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" ) |
This file contains hidden or 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 | |
#filename seerver_moniter.sh | |
mem_quota=20 | |
hd_quota=50 | |
cpu_quota=80 | |
# watch memory usage | |
watch_mem() |