Skip to content

Instantly share code, notes, and snippets.

@pixeldevsio
pixeldevsio / HumanMade S3 Digital Ocean Instructions
Last active May 2, 2024 06:57
Use HumanMade S3 plugin with Digital Ocean Spaces
These are the two steps you need to take to get S3 to work with Digital Ocean Spaces.
https://github.com/humanmade/S3-Uploads
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 2, 2024 06:57
set -e, -u, -o, -x pipefail explanation
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active May 2, 2024 06:56
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@cjyar
cjyar / mbr-to-gpt-uefi.md
Last active May 2, 2024 06:55
Convert a disk from MBR to GPT+UEFI, in Linux.

Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It's easy to mess this up!

  1. Use gdisk to convert the partition table to GPT.

    gdisk /dev/sda

  2. Create the "BIOS boot" partition that GRUB needs.

    n to create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. Use L or l to look up the code for "BIOS boot" (ef02).

  3. Write the new partition table.

    w

  4. Reload the partition table. > partprobe /dev/sda
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 2, 2024 06:55
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active May 2, 2024 06:51
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@memphys
memphys / shortcuts.md
Created March 28, 2012 12:22
Bash Shortcuts For Maximum Productivity

source: http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

Command Editing Shortcuts

  • Ctrl + a – go to the start of the command line
  • Ctrl + e – go to the end of the command line
  • Ctrl + k – delete from cursor to the end of the command line
  • Ctrl + u – delete from cursor to the start of the command line
  • Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
  • Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
@chranderson
chranderson / nvmCommands.js
Last active May 2, 2024 06:48
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node