Skip to content

Instantly share code, notes, and snippets.

@milesrichardson
milesrichardson / inherit_environment_variables_from_pid_1.md
Created January 21, 2023 07:35
inherit environment variables from PID 1

You can inherit the environment variables from PID 1 by iterating over the list of null-terminated strings in /proc/1/environ, parsing the first characters up to the first = as the variable name, setting the remaining value as that variable, and exporting it.

The Code Snippet

This works with multiline environment variables, and environment variables with arbitrary values, like strings, including = or JSON blobs.

Paste this in your current terminal session to inherit the environment variables from PID 1:

@bocajnotnef
bocajnotnef / instructions.md
Last active March 28, 2024 08:17
scripts for converting the 1993 annotated RTF files of "A Fire Upon The Deep" to HTML

source material

You'll need the download of the Hugo 1993 files, available from here. If that link dies, you can scour the original HackerNews post to see if anyone has a mirror, or if there's other helpful files

deps

mac

  • libreoffice installed to the Applications/ dir
  • xmllint I think comes for free?
  • coreutils from brew (e.g. brew install coreutils)
@nuchi
nuchi / green_links_on_google.txt
Last active January 26, 2020 07:30
Restore green links and no favicons on Google with uBlock Origin
@IanColdwater
IanColdwater / twittermute.txt
Last active May 23, 2024 18:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@joerodgers
joerodgers / ROIScan.vbs
Created July 19, 2019 15:33
ROIScan.vbs
' Name: Robust Office Inventory Scan - Version 1.9.1
' Author: Microsoft Customer Support Services
' Copyright (c) Microsoft Corporation. All rights reserved.
' Script to create an inventory scan of installed Office applications
' Supported Office Families: 2000, 2002, 2003, 2007
' 2010, 2013, 2016, O365
Option Explicit
On Error Resume Next
Const SCRIPTBUILD = "1.9.1"
@MattPD
MattPD / analysis.draft.md
Last active June 6, 2024 00:22
Program Analysis Resources (WIP draft)
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active June 7, 2024 17:18
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@loziju
loziju / macosx-configure-postfix-as-relay.md
Last active May 4, 2024 23:51
Configure postfix as relay for OS X
@trusktr
trusktr / DefaultKeyBinding.dict
Last active June 13, 2024 01:32
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@Chaser324
Chaser324 / GitHub-Forking.md
Last active June 16, 2024 07:13
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