Skip to content

Instantly share code, notes, and snippets.

View ryupold's full-sized avatar

Michael Scherbakow ryupold

View GitHub Profile
@ryupold
ryupold / Utils.cs
Created December 15, 2020 13:28
Xamarin Forms Get Element bounds for iPad share dialoge
using System;
using Xamarin.Forms;
public static class Utils
{
public static Rectangle GetAbsoluteBounds(this Xamarin.Forms.View element)
{
Element looper = element;
var absoluteX = element.X + element.Margin.Top;
@ryupold
ryupold / README.md
Last active November 24, 2019 15:58
Tool to parse journalctl output, find failed ssh login attempts and log them in a CSV file

authtracker.go

Tool to parse journalctl output, find failed ssh login attempts and log them in a CSV file

usage

sudo journalctl -f | go run authtracker.go
@ryupold
ryupold / env.sh
Created May 17, 2019 12:39
2 ways to set environment variables in macOS
launchctl setenv APP_VERSION "$APP_VERSION"
echo "App Version: $(launchctl getenv APP_VERSION)"
echo ""
export APP_VERSION=1.2.3
launchctl setenv APP_VERSION "1.2.3"
export APP_VERSION=$(launchctl getenv APP_VERSION)
@ryupold
ryupold / Commander.cs
Created April 2, 2019 21:29
typesafe generic command execution
using System;
using System.Threading.Tasks;
namespace Cli
{
public class Program
{
static void Main(string[] args)
{
var cmdr = new Commander<Unit, string>(() => new ReturnStuffCommnad<string>("12345"))
@ryupold
ryupold / limit.sh
Last active March 21, 2019 14:27
Hitting max. open files on macOS
# list top apps with open handles
sudo lsof -n | cut -f1 -d' ' | uniq -c | sort | tail
#show limits
launchctl limit maxfiles
#increase limits
sudo launchctl limit maxfiles 65536 200000
@ryupold
ryupold / .. my unix config files
Last active March 26, 2019 10:49
unix/linux config files
config files for linux/unix systems
@ryupold
ryupold / keybindings.json
Last active March 25, 2019 22:38
VSCode settings/bindings etc
// Place your key bindings in this file to overwrite the defaultsauto[]
[
//vim
{
"key": "ctrl+alt+shift+v",
"command": "toggleVim"
},
// clojureVSCode
{
"key": "alt+enter",
//go build -ldflags -Hwindowsgui
package main
import (
"os/exec"
)
func main() {
cmd := exec.Command("procexp.exe")
err := cmd.Start()
@ryupold
ryupold / iota_sync.go
Created December 11, 2017 20:42
check sync status of an IOTA full node
//USAGE: go run iota_sync.go http://IP:PORT
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
@ryupold
ryupold / main.go
Last active May 7, 2018 17:05
Convert *.resx file to JSON
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"strings"
)