Skip to content

Instantly share code, notes, and snippets.

@sivel
sivel / better-ssh-authorized-keys-management.md
Last active May 3, 2024 14:20
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@hansheng0512
hansheng0512 / README.md
Last active May 3, 2024 14:19
Increase SWAP Memory Size in Jetson Nano
  1. Run Command Below
sudo apt-get install -y dphys-swapfile
  1. Run sudo gedit /sbin/dphys-swapfile
  2. Change CONF_MAXSWAP to 4096, save and exit
  3. Run sudo gedit /etc/dphys-swapfile
  4. Enable CONF_SWAPSIZE and put 4096, save and exit
  5. Run sudo reboot . to restart Jetson Nano 7.Run free -m and check the Swap total
@joonaszure
joonaszure / CreateAndValidateWithKeys.cs
Last active May 3, 2024 14:19
Using Azure Key Vault keys for signing and encrypting JSON Web Tokens
var vaultUri = new Uri("https://your-key-vault.vault.azure.net/");
var credential = new AzureCliCredential(new AzureCliCredentialOptions
{
TenantId = "your-aad-tenant-id"
});
var keyClient = new KeyClient(vaultUri, credential);
var cryptoProviderFactory = new CryptoProviderFactory();
cryptoProviderFactory.CustomCryptoProvider = new KeyVaultCryptoProvider(keyClient);

Links for Nisght tools and tutorials

Download center

Installing Nsight compute from command-line:

# Download .run file from website and accept the terms and conditions.
sudo ./nsight-compute-linux-2020.1.1.8-28506821.run --nox11
@unicornist
unicornist / Native Date and Number Formatting.js
Last active May 3, 2024 14:15
Natively Format Javascript Dates & Numbers in different Locales (Including Persian Calendar)
(12345.6789).toLocaleString("fa-IR"); // ۱۲٬۳۴۵٫۶۷۹
var now = new Date();
now.toLocaleString(); // 1/27/2018, 12:07:03 AM
now.toLocaleDateString(); // 1/27/2018
now.toLocaleTimeString(); // 12:07:03 AM
now.toLocaleString("fa-IR") // ۱۳۹۶/۱۱/۷،‏ ۰:۰۷:۰۳
now.toLocaleDateString("fa-IR") // ۱۳۹۶/۱۱/۷
@GreenCrowDev
GreenCrowDev / godot_gdextension_beginners_001.md
Last active May 3, 2024 14:15
Godot 4 GDExtension plugin development for beginners [Part 1]

Typing SVG

I'm on X (formerly Twitter) Follow and YouTube Channel Subscribers , anyone is welcome: feel free to get in contact if you need any help!
If you appreciate my work, consider buying me a coffee and help me go full-time!

@sgyyz
sgyyz / uao.md
Last active May 3, 2024 14:15
uao command - unzip your project and import to intellij automatically
  1. import project into idea command
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
  1. unzip and open project command
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
@Klerith
Klerith / configurar-node-ts.md
Last active May 3, 2024 14:14
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@krazylearner
krazylearner / setup_jdb.md
Last active May 3, 2024 14:12
set up jdb with android

start bluestack or emulator install app on it start the app

connect adb to emulator

$ adb connect localhost:5555

get 'pid' of your app .Dont forget to run it first in emulator