I hereby claim:
- I am mendhak on github.
- I am mendhak (https://keybase.io/mendhak) on keybase.
- I have a public key whose fingerprint is 6989 CF77 4903 69CF FDCB CD89 95E7 D75C 76CB E9A9
To claim this, I am signing this object:
| public static String GetUrl(String url) throws Exception | |
| { | |
| URL serverAddress = null; | |
| HttpURLConnection connection = null; | |
| // OutputStreamWriter wr = null; | |
| BufferedReader rd = null; | |
| StringBuilder sb = null; | |
| String line = null; | |
| try |
| sshfs username@machinename.local:/home/username /mnt/mountname -p 1234 -o allow_other -o IdentityFile=/home/mendhak/Documents/keys/id_rsa | |
| import time | |
| import socket | |
| def collect_metric(name, value, timestamp): | |
| sock = socket.socket() | |
| sock.connect( ("localhost", 2003) ) | |
| sock.send("%s %d %d\n" % (name, value, timestamp)) | |
| sock.close() | |
| def now(): | |
| return int(time.time()) |
I hereby claim:
To claim this, I am signing this object:
| #Source: https://stackoverflow.com/questions/2241063/bash-script-to-setup-a-temporary-ssh-tunnel | |
| #SSH feature - control sockets | |
| ssh -4 -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -M -S my-ctrl-socket -fnNT -L 10023:remoteserver.com:8000 dev@middleserver.internal | |
| #Get PID - you'll have to parse this | |
| ssh -S my-ctrl-socket -O check dev@middleserver.internal | |
| #Exit | |
| ssh -S my-ctrl-socket -O exit dev@middleserver.internal |
| public static T GetValue<T>(this DataRow row, string field) | |
| { | |
| if (!row.Table.Columns.Contains(field)) | |
| { | |
| return default(T); | |
| } | |
| else | |
| { | |
| return (T)Convert.ChangeType(row[field].ToString(), typeof(T)); |
| public static class DataRecordExtensions | |
| { | |
| public static T GetValue<T>(this IDataRecord reader, string columnName) | |
| { | |
| object columnValue = reader[columnName]; | |
| T returnValue = default(T); | |
| if (!(columnValue is DBNull)) | |
| { | |
| returnValue = (T)Convert.ChangeType(columnValue, typeof(T)); | |
| } |
| import sys | |
| import operator | |
| # Given the data part of an NMEA sentence (Remove the $, remove the * onwards, keep the last comma) | |
| # calculates the checksum | |
| def checksum_calculate(nmeadata): | |
| csum = 0 | |
| for c in nmeadata: | |
| csum ^= ord(c) |
| import os | |
| import pytz | |
| import sys | |
| import datetime | |
| import dateutil.parser | |
| import boto | |
| downloadFolder = "downloads" | |
| if len(sys.argv) > 1: |
| #!/usr/bin/python3 | |
| """ | |
| msysGit to Unix socket proxy | |
| ============================ | |
| This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows). | |
| It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the | |
| ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other |