Skip to content

Instantly share code, notes, and snippets.

View csobankesmarki's full-sized avatar
💭
Just meditate.

Csoban Kesmarki csobankesmarki

💭
Just meditate.
  • Hungary
View GitHub Profile
@csobankesmarki
csobankesmarki / cloudflare-ddns-update.sh
Created September 5, 2024 07:00 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@csobankesmarki
csobankesmarki / socket_file.sh
Created October 21, 2021 13:15 — forked from jadell/socket_file.sh
Read and write to a socket using only Bash
#!/bin/bash
#
# Bash must have been compiled with this ability: --enable-net-redirections
# The device files below do not actually exist.
# Use /dev/udp for UDP sockets
exec 3<>/dev/tcp/host/port
# Write to the socket as with any file descriptor
echo "Write this to the socket" >&3
@csobankesmarki
csobankesmarki / gitignore_per_git_branch.md
Created October 8, 2021 06:27 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

copied from http://www.lorier.net/docs/ssh-ca - all credit there.
## Using a CA with SSH
Using a CA with ssh means you can sign a key for a user, and everywhere that the user trusts the CA you can login, without having to copy your SSH key everywhere again. This allows for things like fast rollover of keys (eg: daily), or trusting the fingerprint of a machine that you're logging into, which can be very useful when you're managing large numbers of machines, or machines that get new host keys (eg by reinstalling) regularly.
You'll probably want at least openssh 5.6, although some of the functionality is available in 5.3.
Creating the CA key
ssh-keygen -f /etc/ssh/ca
@csobankesmarki
csobankesmarki / ssh_term_pkcs11_2.go
Created November 19, 2020 07:39 — forked from blacknon/ssh_term_pkcs11_2.go
ssh_term_pkcs11_2.go
package main
import (
"crypto"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/ThalesIgnite/crypto11"
package main
import (
"crypto"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/ThalesIgnite/crypto11"
package main
/*
#cgo CFLAGS: -I/usr/include/
#cgo LDFLAGS: -ldinamo -ltacndlib
#include <dinamo.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@csobankesmarki
csobankesmarki / sec_browse.py
Created May 17, 2020 21:47 — forked from rootVIII/sec_browse.py
sec_browse.py - Auto-configures Firefox network settings and opens a secure Tor/Firefox browser session for the # time specified by -t
#! /usr/bin/python3
from os import popen, remove, getcwd
from selenium import webdriver
from subprocess import call
from sys import exit
from time import sleep
from argparse import ArgumentParser
from threading import Thread
# rootVIII
# sec_browse.py - Auto-configures Firefox network settings