Skip to content

Instantly share code, notes, and snippets.

View rsenna's full-sized avatar
🏠
Working from home

Rogério Senna rsenna

🏠
Working from home
  • Thoughtworks
  • Barcelona, Spain
  • 13:36 (UTC +02:00)
  • X @rsenna
View GitHub Profile
@CGamesPlay
CGamesPlay / import.py
Created December 14, 2024 00:58
Migrate Obsidian (or markdown directory) to Anytype markdown import
#!/usr/bin/env python3
# /// script
# dependencies = [
# "mistune==3.0.2",
# ]
# ///
import os
import sys
import hashlib
@pmarreck
pmarreck / comparison-of-shells.md
Last active May 22, 2025 01:55
Comparison of Bash, Elvish, NuShell, Murex, es-shell, fish, xonsh, PowerShell, Oil and Ion shells

(generated by chatgpt 4o and reviewed/edited by claude 3.5 sonnet, YMMV)

| Feature | Bash | Elvish | NuShell | Murex | Es Shell | Fish | Xonsh | PowerShell | Oil | Ion | |----------------------------------|-----------------------------------------------|-----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|----------------------------------------------|-------------------------

@GiovanniGrieco
GiovanniGrieco / Setup-Podman-on-LXC.md
Last active November 7, 2024 07:36
Setup Podman on LXC

Before you start, please NOTE: this guide does not cover rootless containers!

On an hypervisor with LXD installed, create a new container, ensuring that -c security.nesting=true -c security.privileged=true is set:

lxc launch -c security.nesting=true -c security.privileged=true images:fedora/35 my-container

If the container already exists, set this parameter through lxc config:

lxc config set my-container security.nesting=true
lxc config set my-container security.privileged=true

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228 in a MacOS using ZSH.

Based on https://gist.github.com/Neo23x0/e4c8b03ff8cdf1fa63b7d15db6e3860b

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders.

@eiriktsarpalis
eiriktsarpalis / Atom.cs
Created June 22, 2019 12:20
Clojure-style atoms for C#
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Atom
{
public class Atom<T> where T : class
{
private T _value;
@timotgl
timotgl / uninstall-razer-synapse.sh
Last active April 16, 2025 13:33
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater
@simeonf
simeonf / pex.md
Last active July 5, 2024 06:19
Creating a PEX from a python script

So you want to create a pex that packages your script and its dependencies?

Ok - first to make our script! Call it foo.py:

import requests

if __name__ == '__main__':
  req = requests.get("https://raw.githubusercontent.com/pantsbuild/pex/master/README.rst")
  print req.text.split("\n")[0]
@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active June 5, 2025 06:53
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@davidfowl
davidfowl / dotnetlayout.md
Last active June 6, 2025 11:10
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Rafe
Rafe / gist:3102414
Created July 13, 2012 02:59
AWK cheatsheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE: