Skip to content

Instantly share code, notes, and snippets.

@cesarmiquel
cesarmiquel / drupal-8-cheatsheet.md
Last active May 3, 2024 14:26
Drupal 8/9/10 Cheatsheet

Drupal 8 Cheatsheet

Files, Images and Media

// Load file object
$file = File::load($fid);

// Get uri (public://foo/bar/baz.png)
$uri = $file->getFileUri();
@SoNothingMC
SoNothingMC / CiderAudio.md
Last active May 3, 2024 14:26
The Complete Guide to Cider Audio Lab

The Complete Guide to Cider Audio Lab

(aka Audio Lab descriptions without the jargon)

Have you wondered just what the f**k do those Cider Audio Lab descriptions mean?
Well, let me break it down for you.


What even is Audio Lab?

Cider Audio Lab is a suite of audio enhancement options that make your music sound better.

@pantor
pantor / nvidia-driver-realtime.sh
Last active May 3, 2024 14:25
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 14:24
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@fendergx
fendergx / ModalCloseDisabled.md
Last active May 3, 2024 14:23
Prevenir cierre de Modal en clic externo #Modal #Bootstrap

Cómo evitar que se cierre el modal al dar clic fuera de él

la opción a base de html es mandar por los parámetros data al dar clic al modal

 <button data-target="#myModal" data-toggle="modal" data-backdrop="static" data-keyboard="false">
    Launch demo modal
 </button>
@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