Skip to content

Instantly share code, notes, and snippets.

View synsa's full-sized avatar

Steve Lang synsa

View GitHub Profile
Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
@synsa
synsa / HardCoreDebugLogger.php
Created May 28, 2021 20:23 — forked from lyrixx/HardCoreDebugLogger.php
Hardcore Debug Logger
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@synsa
synsa / README.md
Created May 17, 2021 11:11 — forked from marshyon/README.md
Golang web server VueJS App in history mode and Go web services

Golang web server VueJS App in history mode and Go web services

vuejs cli

with the vuejs cli installed (https://github.com/vuejs/vue-cli)

vue init webpack my-project

answer questions for project setup, optionally installing unit tests but yes to vue-router

@synsa
synsa / install_mysql_in_wsl.md
Created May 9, 2021 22:16 — forked from zhensongren/install_mysql_in_wsl.md
Set up MySQL on local machine (Windows Subsystem for Linux, WSL2)

Upgrade the Repositories

sudo apt update sudo apt upgrade

Install MySQL 5.7

sudo apt install mysql-server

Secure MySQL Installation

sudo apt install mysql-server #To do the high security provide all answers to yes

@synsa
synsa / cgo1.go
Created May 9, 2021 09:26 — forked from tejainece/cgo1.go
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@synsa
synsa / parseStatusDat.py
Created May 8, 2021 20:12 — forked from koemu/parseStatusDat.py
Nagios status.dat parser for python.
# -*- coding: utf-8 -*-
import sys
import re
# ----------------------------------------------
def parseFile( path, result ):
"""
@synsa
synsa / haproxy.cfg
Created April 26, 2021 17:44 — forked from T0MM0R/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@synsa
synsa / sshremote.go
Created April 15, 2021 08:15 — forked from josephspurrier/sshremote.go
Golang Remote Execution
package main
/*
// Example
sci := ServerConnInfo{
"127.0.0.1",
"22",
"ubuntu",
`key.pem`,
}
@synsa
synsa / authentication_with_express_postgres.md
Created March 31, 2021 05:48 — forked from laurenfazah/authentication_with_express_postgres.md
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@synsa
synsa / log.go
Created March 25, 2021 19:14 — forked from Tantas/log.go
Apache access logs for golang.
import (
"fmt"
"io"
"net/http"
"strings"
"time"
)
// https://httpd.apache.org/docs/2.2/logs.html#combined + execution time.
const apacheFormatPattern = "%s - - [%s] \"%s %s %s\" %d %d \"%s\" \"%s\" %.4f\n"