Skip to content

Instantly share code, notes, and snippets.

module Main where
-- http://files.farka.eu/pub/AC21007/lec5.pdf
insSortImpl :: [Int] -> [Int] -> [Int]
insSortImpl sorted [] = sorted
insSortImpl sorted (x:xs) =
insSortImpl (insert x sorted) xs
where
insert y [] = [y]
package com.brums.app;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.SQLException;
public class App {
public static void main(String[] args) {

Since the nix store is immutable and cannot be modified, you need to define a writable location for NPM packages to be installed globally.

Install NodeJS if you haven’t already.

Add the following to your ~/.npmrc to have it put the packages in the ~/.npm-packages folder:

prefix = ${HOME}/.npm-packages

You need to add the npm bin folder to your PATH in your shell’s rc file (i.e. .bashrc or .zshrc for example, so you can access the executables:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
#https://itsfoss.com/disable-ipv6-ubuntu-linux/
# sample command to capture camera output, makesure ffmpeg is installed
ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 -video_size 640x480 test.jpeg
# To run the same thing inside the docker image
# run docker in privilaged mode with binding appropriate dirs
docker run --privileged \
--mount type=bind,source=/dev,target=/dev \
--mount type=bind,source=/home/fatlady,target=/root \
--rm -it alpine /bin/sh
@jayendra13
jayendra13 / help.sh
Created April 27, 2024 04:30
gcloud helpers
# List all the VM for given project
gcloud compute instances list --format="text(name,zone.basename())"
# List all the VM for given project in table format with id
gcloud compute instances list --format="table(id, name,zone.basename())"
# List all the VM get only id for shell processing
gcloud compute instances list --format="csv[no-heading](id)"
# Get service account for given vm