Skip to content

Instantly share code, notes, and snippets.

View cjekel's full-sized avatar

Charles Jekel cjekel

View GitHub Profile
@cjekel
cjekel / keras_hyper_tune.py
Created April 29, 2020 16:41
Example of keras hyperparamter turning with bayesian optimization
# -- coding: utf-8 --
# MIT License
#
# Copyright (c) 2020 Charles Jekel (cj@jekel.me)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@cjekel
cjekel / add_up_down.py
Created November 19, 2019 17:56
fix openvpn dnsleak with up down commands replace with python file
from glob import glob
files = glob('*.ovpn')
for myfile in files:
with open(myfile, 'r') as f:
my_txt = f.read()
my_txt = my_txt.replace('client', 'client\nscript-security 2 \nup /etc/openvpn/client.up\ndown /etc/openvpn/client.down', 1)
with open(myfile, 'w') as f:
f.write(my_txt)
@cjekel
cjekel / add_auth.py
Created November 19, 2019 16:37
Add pass.txt to all open vpn files with python
from glob import glob
files = glob('*.ovpn')
for myfile in files:
with open(myfile, 'r') as f:
my_txt = f.read()
my_txt = my_txt.replace('auth-user-pass', 'auth-user-pass /etc/openvpn/pass.txt')
with open(myfile, 'w') as f:
f.write(my_txt)
@cjekel
cjekel / gist:cc82087e27df020967ecf40060bdf7fd
Created May 3, 2019 18:13
Powershell command line for sorting by filesize
rem http://winteltools.com/directory-size/
ls | add-member -force -PassThru -name length -type scriptproperty -value { ls $this -Recurse -force | Measure-Object length -Sum | select -ExpandProperty sum } | Sort-Object length -Descending | Format-Table Name, @{label=“length”; expression={$_.length/1GB}; f=“{0:N2}”} -autosize
# Get started with OpenSuse in a VM VirtualBox
# OpenSuse just doesn't work in a virtual box, follow this and it will work
# installing the guest additions from VM 5.0.20 doesn't work
# the auto run script from guest additions also won't work
# From https://forums.opensuse.org/showthread.php/502328-13-2-Virtualbox-guest-and-shared-folders-in-media thanks to jetchisel
# Create /media and assign permissions
mkdir /media
chmod o+rw /media