Skip to content

Instantly share code, notes, and snippets.

View thomasuebel's full-sized avatar
🤘
Working from home

Thomas Uebel thomasuebel

🤘
Working from home
View GitHub Profile
@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active March 15, 2024 14:13
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
@carlos-jenkins
carlos-jenkins / multihooks.py
Last active August 10, 2023 22:12
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@efasel
efasel / list_swap_proc.sh
Created February 8, 2016 16:52
sorted list of processes with amount of swapped memory
#!/bin/bash
for pid in $(cd /proc && find . -maxdepth 2 -type f -name status | grep -o '[0-9]*'); do grep -q VmSwap /proc/$pid/status > /dev/null 2>&1 && echo -n "$(grep VmSwap /proc/$pid/status)" && ps h -p $pid -o args ; done | sort -k 2 -n -r | cut -c 1-200
@vanderlin
vanderlin / Sublime Text 3 Command
Last active March 21, 2023 07:49
Create a Sublime Text 3 symbolic link to open a file via command line. paste this into terminal and now you can run `subl .` to open the directory in sublime or `subl file.html`
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@ashrithr
ashrithr / kerberos_setup.md
Last active May 16, 2024 03:22
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1