Skip to content

Instantly share code, notes, and snippets.

@luszczynski
luszczynski / keycloak_get_idp_token.md
Last active December 19, 2023 10:32
Keycloak - Get IDP Token using Curl

Keycloak - Get IDP Token

Get Access Token

export TKN=$(curl -X POST 'http://127.0.0.1:8080/auth/realms/your-realm/protocol/openid-connect/token' \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d "username=your-user" \
 -d 'password=your-pass' \
 -d 'grant_type=password' \
@gitpel
gitpel / install-of-eset-esmc-7-webconsole-at-lxc-on-ubuntu-18-04.md
Last active January 13, 2021 20:45
Installation of ESET ERA: ESMC 7 & Web Console at LXC (Linux Container) on Ubuntu 18.04 LTS

Installation of ESET ERA: ESMC 7 & Web Console at LXC (Linux Container) on Ubuntu 18.04 LTS

Tested on LXC container with Ubuntu 18.04 LTS

Read about How to install LXC\LXD on Ubuntu: https://linuxcontainers.org/lxd/getting-started-cli/

On LXC\LXD Host Mashine create a containe with Ubuntu 18.04 with name "eset"

lxc launch images:ubuntu/18.04 eset
@ageis
ageis / systemd_service_hardening.md
Last active May 4, 2024 15:57
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@stefansundin
stefansundin / requests_api.py
Last active April 11, 2024 16:23
Reusable class for Python requests library.
# http://docs.python-requests.org/en/master/api/
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@gavinhungry
gavinhungry / nginx-tls.conf
Last active March 11, 2024 14:51
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 2, 2024 05:49
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@monkyz
monkyz / linux_ssh_bastion
Created October 7, 2012 20:48
Creating a transparent SSH tunnel through a bastion host
source article:
http://backdrift.org/transparent-proxy-with-ssh
Creating a transparent SSH tunnel through a bastion host using the ProxyCommand configuration parameter
Tags: linux, ssh, unix
Like most users out there (I think) my systems are usually configured to allow ssh connections from a small handfull of trusted hosts or a bastion host. This is decent security practice but is a total pain when you want to scp a file or grab the stdout of a command from a host outside the trusted area. Or perhaps you have a number of hosts on a private subnet and only one routable host to get in through. I was able to set up a method which allows for transparent access to a host while behind the scenes tunneling through a trusted bastion host involving some pretty minor adjustments to the .ssh/config file.
Here’s how it works: