Skip to content

Instantly share code, notes, and snippets.

@ddrscott
ddrscott / histogram.sql
Last active December 9, 2022 18:03
Histogram for PostgreSQL without width_bucket.
WITH params AS (
-- Parameters for down stream queries
SELECT
15 AS bucket_count,
80 AS max_bars
),
numbers AS (
-- Change this query to select real data.
-- For now we make random set of numbers.
SELECT
@pdp7
pdp7 / Build fbtft drivers for Linux 4.4 on BeagleBone Black.txt
Created November 24, 2015 21:54
Build fbtft drivers for Linux 4.4 on BeagleBone Black
laptop$ git clone https://github.com/RobertCNelson/bb-kernel
laptop$ cd bb-kernel/
laptop$ git checkout am33x-v4.4
laptop$ ./build_kernel.sh
# enable Device Drivers->Staging->fbtft
# flash SD card
laptop$ wget https://rcn-ee.com/rootfs/bb.org/testing/2015-11-15/console/bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz
laptop$ xz -d bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz
laptop$ sudo dd if=/home/afustini/Downloads/bbb-images/bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz of=/dev/sdc
@IQAndreas
IQAndreas / caesar-cipher.sh
Last active July 19, 2024 21:01
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead