Skip to content

Instantly share code, notes, and snippets.

@nebulak
nebulak / ca-setup.md
Last active February 2, 2024 20:44
python mutual tls for client certificate validation
# sources:
# https://kb.op5.com/pages/viewpage.action?pageId=19073746#sthash.9gTMRKM1.dpbs
# https://stackoverflow.com/a/26093147
# https://jamielinux.com/docs/openssl-certificate-authority/sign-server-and-client-certificates.html
# additional ressource: https://gist.github.com/Soarez/9688998
# TODO: renew certificates and ca, add capability for authentication to client cert
# TODO ressources: https://gist.github.com/richieforeman/3166387

HKP_PATH=""

@nebulak
nebulak / cert-curl.php
Last active February 12, 2022 03:06
PHP curl request with ssl/tls client certificate
<?php
//source: http://www.zedwood.com/article/php-curl-connect-with-ssl-client-certificate
class SecureRequest
{
private m_publicCertPath; //"/public_cert.pem"
private m_privateCertPath; //"/private.pem")
private m_caInfoPAth; //"/etc/ssl/certs/ca-certificates.crt"
public function init($publicCertPath, $privateCertPath, $caInfoPath) {
$this->m_publicCertPath = $publicCertPAth;
@nebulak
nebulak / StatusIcon.py
Created October 18, 2018 09:15 — forked from pklaus/StatusIcon.py
StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."
@nebulak
nebulak / custom-desktop-category.txt
Created September 12, 2018 11:27
custom desktop category
# //source: https://ubuntuforums.org/showthread.php?t=2184825
Ok i've managed to get this done. I will give a quick how to based on a new custom folder called "Atari 800" (That's the shortcuts i originally wanted seperate from the rest)
1..Create a file called atari800.menu (substitute atari 800 for whatever you want to call it) in the folder location etc/xdg/menus/applications-merged
2..Input these contents
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
@nebulak
nebulak / gpg-agent.conf
Created September 12, 2018 11:08
gpg-agent.conf
enable-ssh-support
write-env-file
default-cache-ttl 60
max-cache-ttl 600
pinentry-program /usr/local/bin/pinentry-keepass
@nebulak
nebulak / gocryptfs-smart-install.sh
Created July 19, 2018 07:33
gocryptfs smart install
# Check for NI
cat /proc/cpuinfo| grep -q "aes"
# NI = 0, if aes-ni supported
# NI = 1, if aes-ni NOT supported
NI=$?
# check architecture
CPUARCH="$(dpkg --print-architecture)"
echo $CPUARCH
@nebulak
nebulak / check-ni.sh
Last active July 14, 2018 14:18
check aes ni
cat /proc/cpuinfo| grep -q "aes"
# NI = 0, if aes-ni supported
# NI = 1, if aes-ni NOT supported
NI=$?
echo $NI
# get architecture
CPUARCH="$(dpkg --print-architecture)"
echo $CPUARCH