Skip to content

Instantly share code, notes, and snippets.

@JF6
JF6 / MongoDB.ps1
Created March 24, 2017 14:00
DSC script for mongoDB installation - quick and dirty
#Adapted from https://gist.github.com/tugberkugurlu/11212976
#Used in ARM template deployment
configuration MongoDB {
#param (
# [string[]]$ComputerName = $env:ComputerName
#)
Import-DSCResource -ModuleName xDisk
Import-DSCResource -ModuleName cDisk
@JF6
JF6 / gist:26d0acf6a529c2d6cb00938851154dfa
Last active July 11, 2017 14:55
Get IPAddress from an Azure Gateway (Mint / CLI 2.0)
az network public-ip list --resource-group GW4 | jq -r '.[].ipAddress' | sed /null/d
az network vnet-gateway list --resource-group GW4 | jq -r ".[].id
az network public-ip list --resource-group GW4 | jq 'if (.[].id=="/subscriptions/7638783c-a1ee-47d6-a06e-cba7ffd4d6bb/resourceGroups/GW4/providers/Microsoft.Network/publicIPAddresses/GW4-IP") then .[].ipAddress else null end'
#Get the IP Address from a AZR VPN Gateway
id=$(az network vnet-gateway list --resource-group GW4 | jq -r '.[].ipConfigurations[].publicIpAddress.id')
ip=$(az network public-ip list --resource-group GW4 | jq -r '.[] | select(.id=="'$id'") | .ipAddress')
sed -e "s/right=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/right=$ip/" ./ipsec.conf
@JF6
JF6 / createVPN.sh
Last active July 17, 2017 20:53
Creare a S2S VPN on Linux Mint
#RFC 3947 ==> https://datatracker.ietf.org/doc/rfc3947/?include_text=1
echo -n Please type the Shared Key:
read sharedKey
echo $sharedKey
activeInterface=$(ip route get 8.8.8.8 | awk '{print $5; exit}')
activeSubnet=$(ip route | grep $activeInterface | grep kernel | awk '{print $1; exit}')
leftip=$(ip route | grep $activeInterface | grep kernel | awk '{print $9; exit}')
@JF6
JF6 / autostart.sh
Created August 5, 2017 17:47
Autostart kodi libreelec: /storage/.config/
(
sleep 30
hdparm -B 127 -S 120 /dev/sda
) &
@JF6
JF6 / conv.py
Created February 10, 2018 21:15
Convert Pascal VOC metadata to darknet format. Python 3 - Work in progress
import xml.etree.ElementTree as ET
import glob
from PIL import Image
import operator
"""
"""
class labelHelper:
def __init__(self):
@JF6
JF6 / sortQt.py
Last active February 24, 2018 16:13
Tkinter program to copy image keepers
# import the necessary packages
from tkinter import *
from PIL import Image
from PIL import ImageTk
import tkinter.filedialog as tkFileDialog
import cv2
import glob
from shutil import copyfile
import os
@JF6
JF6 / cam.py
Last active September 8, 2019 13:14
from time import sleep
from picamera import PiCamera
import datetime
import os
def log(inner_fucntion):
def wrapper(*args, **kwargs):
print('Entering {} with arguments {}, {}'.format(inner_fucntion.__name__, *args, **kwargs))
res = inner_fucntion(*args, **kwargs)
@JF6
JF6 / loghelper.py
Created April 19, 2020 11:39
logHelper
'''
logHelper : Helps logging
'''
import logging
import datetime
import os
def init(file_name, mod_name=__name__, level=logging.DEBUG) -> logging.Logger:
'''
@JF6
JF6 / environment.yml
Created May 7, 2020 08:05
anaconda cuda env
name: cuda
channels:
- defaults
dependencies:
- cudatoolkit
- tensorflow-gpu
- matplotlib
prefix: /home/jfsix/anaconda3/envs/cuda
@JF6
JF6 / agnoster2.zsh-theme
Created August 5, 2022 08:38
Tweaked agnoster2 theme, easier on the eyes
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline