Skip to content

Instantly share code, notes, and snippets.

View Harkishen-Singh's full-sized avatar
💭
Engineering high-perf tools

Harkishen Singh Harkishen-Singh

💭
Engineering high-perf tools
View GitHub Profile

Download skillshare course playlist without signup

This gist tells you how to download a skillshare course playlist without any signup.

Go to https://colab.research.google.com/github/calvinhobbes23/Skillshare-DL/blob/master/Skillshare_DL_[KENWAY].ipynb#scrollTo=W4DvOJaqsGaj

Signin with a gmail ccount (I recommend a fake gmail account)

Make sure that there is enough space in your Google Drive since this script downloads and transfers the videos to the Google Drive of the account provided.

@Harkishen-Singh
Harkishen-Singh / cgroups_docker_error_fix.md
Created July 22, 2021 07:45
Fix cgroups error in docker

In order to fix cgroups error in running docker, try these commands and restart your system. One of them should work.

sudo update-grub "systemd.unified_cgroup_hierarchy=0"

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

@Harkishen-Singh
Harkishen-Singh / Davinci fixes.md
Created July 24, 2021 11:55
Quick Davinci Resolve fixes. When I created this gist, I was using DR 17 version. Please comment if you have better ideas.

If you get The Fusion composition on the current frame or clip could not be processed successfully, then a woking fix for me is

Go to Preference<User<Ui and uncheck the "Stop renders when a frame or clip cannot be processed".

After doing this DR was able to render the project. Also all effects etc. were visible and no frame was dropped. Nontheless if somebody knows it better or why this is a bad Idea, please feel free to lecture me.
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
sudo apt update
sudo apt-get install gcc -y
wget -c https://dl.google.com/go/go1.17.4.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profile
go version
@Harkishen-Singh
Harkishen-Singh / prometheus_tsdb_index_layout_gist.md
Created December 16, 2021 11:27
This Gist explains Prometheus's tsdb index layout along with some implementation details at various steps.
STEP 1: When AddSymbol() is called
----------------------------------------
alenblen;label_name_1;label_value_1;label_name_2;label_name_3;label_value_2;label_value_3;

remarks: "alenblen" is the space reserved for symbol table metadata, like size of the symbol table, and number of symbols.
This is overwritten in the finishSymbol().

STEP 2: When finishSymbol() is called
----------------------------------------

Code that ingests duplicates

package main

import (
	"context"
	"time"

	"github.com/go-kit/log"
@Harkishen-Singh
Harkishen-Singh / generate_counter_data_postgres.md
Created October 31, 2022 10:53
This Gist helps to generate Prometheus Counter data behaviour on TimescaleDB/PostgresQL

Generate counter metric data

This example was done on TimescaleDB@2.8.1.

Create function

create or replace function generate_counter_data(_from timestamptz, _till timestamptz, _step interval, _insert_table_name TEXT) returns void as
$$
    declare
        r record;
 counter integer := 0;
@Harkishen-Singh
Harkishen-Singh / Duplicate all tables in Postgres.md
Last active May 8, 2023 10:26
Duplicate all tables in Postgres

duplicate all tables under 'public'

do
$$
declare
    r record;
    prefix text := 'copy_1_';
    total integer := (SELECT count(table_name)::integer FROM information_schema.tables WHERE table_schema = 'public');
    current integer := 0;
begin