Skip to content

Instantly share code, notes, and snippets.

View ChocolateLoverRaj's full-sized avatar

Rajas Paranjpe ChocolateLoverRaj

View GitHub Profile
@ChocolateLoverRaj
ChocolateLoverRaj / La Chantaje.md
Last active September 23, 2021 17:27
La Chantaje

Un día, Jojo recibío un chantaje.

Dame todos tu dinero

Por que?

Tengo un cuchillo.

Por que?

@sindresorhus
sindresorhus / esm-package.md
Last active July 7, 2024 17:10
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
/*
* Very simple test runner for nodejs:
*
* Supports:
*
* before, after, beforeAll, afterAll
* fixture object passed to each test, that before/after/beforeAll/afterAll can modify
* -[t]est option on command line to pick tests to run
* -[l]inear option on command to disable parallel
* built in fixture logger, captures log lines, adds line numbers/file names/timestamps
@kabili207
kabili207 / Rclone systemd service.md
Last active June 24, 2024 11:31
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@Edu4rdSHL
Edu4rdSHL / luks-upgrade.md
Last active April 29, 2024 02:11 — forked from kravietz/luks-upgrade.md
Ubuntu LUKS cryptsetup upgrade

If you installed your #ubuntu with full-disk #encryption a while, you may want to upgrade your #luks header version to enjoy improved #security and stronger password hashing algorithms.

Boot from USB

You can't change LUKS header from a live system - you need to boot a live Ubuntu USB to be able to access the encrypted partition. First, create a bootable USB stick using a regular Ubuntu installer image.

  • Just get the latest installer ISO available
  • You need the full installer, the mini network installer won't work
  • You may need to disable Secure Boot in BIOS temporarily to boot from USB
@nijave
nijave / metered.ps1
Created June 23, 2019 14:56
Powershell check if on metered network
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost()
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted")
@stonehippo
stonehippo / nodejs_raspberry_pi.md
Last active April 21, 2024 01:07
Methods for installing Node.js on Raspberry Pi

Setting Up Node.js On Raspberry Pi

There are several ways that you can set up Node.js on a Raspberry Pi when running Raspbian/Rapberry Pi OS. Depending on your needs, the version of the RPi that you're using, and how you like to manage installs, you have a lot of options.

Node.js from source

Do not do this if you can avoid it, it's super slow. If you insist on doing it and have the time, you can start at https://nodejs.org. But really, don't do this.

If you have tons of time on your hands, don't need Node anytime soon, and insist on building from source for some reason, here's a guide you can try out that covers building Node.js on an ARMv6 Raspberry Pi.

Side note: unless you have a need for the latest and greatest features, I recommend developing using the most recent Long Term Support (LTS) version of Node available, especially for anything you plan to put into production for any length of time.

@qntmpkts
qntmpkts / install-vsc.sh
Created September 17, 2017 17:53
Install Visual Studio Code Insiders in Crouton Chroot (ChromiumOS/ChromeOS)
#!/usr/bin/env sh
_install_vsc() {
echo "Re-entering chroot to complete installation..."
sudo enter-chroot -n ${1} sudo -S sh -c "curl -L https://go.microsoft.com/fwlink/?LinkID=760865 > /tmp/code-insiders.deb; sudo dpkg -i /tmp/code-insiders.deb; sudo apt-get install -f; rm /tmp/code-insiders.deb;";
if [ $? -eq 0 ]; then
echo "Code install script complete.";
else
echo "Code install script failed.";
exit 1;
@inlife
inlife / uv_read_file.c
Created February 13, 2017 13:58
Sample for reading a file asynchronously using libuv
// Sample for reading a file asynchronously using libuv
// taken from https://www.snip2code.com/Snippet/247423/Sample-for-reading-a-file-asynchronously
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <uv.h>
static uv_fs_t openReq;
static uv_fs_t readReq;
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active July 5, 2024 14:57
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip