Instantly share code, notes, and snippets.

View port_forward_using_SSH.md
  1. Open putty
  2. Set host name: hostname.onedumb.com, port: 203
  3. In category, go to Connection->SSH->Tunnels, set Source port: 1433, Destination: sqlhost:1433
  4. Click Add button
  5. Click open, login as: pi password: 1qazxsw2
  6. It should be connected to the server, keep it in hte background
  7. Open SQLServer client
  8. Servername: 127.0.0.1
  9. Login: SA
  10. Password: passWORD
View initialize_unix_profile.md
  • Add sudoer
# Config editor
sudo update-alternatives --config editor

#add user to sudoer
vi /etc/sudoers (visudo)

## Allow root to run any commands anywhere
View win_path2wsl_path.py
'''Convert windows path to wsl path'''
windows_path = r'''C:\Users\chdu\Desktop\Portal\Management\Google Cloud Training'''
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))
View data_group.py
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]]
View caffeine.vbs
Dim objResult
Set objShell = WScript.CreateObject("WScript.Shell")
Do While True
Wscript.Sleep(3000)
objResult = objShell.sendkeys("{SCROLLLOCK}")
Wscript.Sleep(100)
objResult = objShell.sendkeys("{SCROLLLOCK}")
Wscript.Sleep(100)
View SP_logic_check.py
import re
KEYWORD_LIST = [
'UPDATE ',
'DELETE FROM ',
'INSERT INTO ',
'CREATE TABLE ',
'DROP TABLE ',
]
View VDI Recovery checklist.md

Suggest print with scale 150% - 200%

  • DB tools:

    • Netezza
    • DBeaver
      • Import projects
        • Carters
  • Software:

    • Chrome
View service_controller.sh
#!/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(){
View starwars.py
import gc
import machine
# import machine
import time
import network
SSID='Poop'
PWD='cockcock'
# Configure GPIO pins 0 and 2 to be used for
View gist:8ec1efae0880397d1a9643f0edaaa998

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.

Patch & recompile libnfc

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