Skip to content

Instantly share code, notes, and snippets.

View amanjeev's full-sized avatar
🦀
#![allow(me_to_explain)]

Amanjeev Sethi amanjeev

🦀
#![allow(me_to_explain)]
View GitHub Profile
@amanjeev
amanjeev / sda raid error
Created March 10, 2014 03:19
sdX raid error while CentOS installation on a previous raid hard drive
# While installing CentOS, if you are using a hard drive that had
# RAID metadata, you will have to delete it using this command from
# shell before the installation from a boot disk
dmraid -r -E /dev/sdX

Keybase proof

I hereby claim:

  • I am amanjeev on github.
  • I am amanjeev (https://keybase.io/amanjeev) on keybase.
  • I have a public key whose fingerprint is 63D2 F667 EB15 8681 FF56 F577 5B3E 588F 66A4 9F56

To claim this, I am signing this object:

@amanjeev
amanjeev / I had a problem
Last active January 23, 2016 17:11
I had a problem...
I had a problem, so I decided to use regexes. Now I have two problems.
I had a problem, so I decided to use Java. Now I have a ProblemFactory.
I had a problem, so I decided to use multithreading. Now problems I two have.
I had a problem, so I decided to use divide and conquer. Now I have two half-problems.
I had a problem, so I decided to use C. Now I hSEGMENTATION FAULT
I had a problem, so I decided to use Lisp. Now (have I (cons 'problem 'problem)).
I had a problem, so I decided to use SQL. Now SELECT COUNT(*) FROM problems = 2.
I had a problem, so I decided to use Haskell. Now I have a monoidal problem in the category of endofunctors.
I had a problem, so I decided to throw it into a strong acid. Now I finally have a solution!
@amanjeev
amanjeev / aws-alb-asg.tf
Created October 7, 2018 04:24
AWS Auto Scaling Group with Application Load Balancer using Terraform
# Create a basic ALB
resource "aws_alb" "my-app-alb" {
name = "my-app-alb"
}
# Create target groups with one health check per group
resource "aws_alb_target_group" "target-group-1" {
name = "target-group-1"
port = 80
protocol = "HTTP"
# A trial to create Jetbrains Toolbox package
{ pkgs ? import <nixpkgs> {} }:
let
name = "jetbrains-toolbox";
version = "1.20.7940";
sha256 = "c156beff24fb6cb1cd5880c5faa9fb65d70dcb93ac7601217574d4e5c9aaad35";
@amanjeev
amanjeev / script-template.sh
Created September 17, 2021 19:02 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@amanjeev
amanjeev / RyzenAdj Tool for Lenovo ThinkPad Gen 2.md
Last active April 1, 2022 18:32
Ryzen Gen 2 Lenovo ThinkPad - Systemd Service and Timer for Power management

Download and build the tool

https://github.com/FlyGoat/RyzenAdj

Deploy this tool somewhere on your machine.

Define the service

Add this to your /etc/systemd/system/ryzenadj.service

[Unit]
@amanjeev
amanjeev / gist:0a752f3a4edd34577804b99e45bf6880
Last active August 19, 2022 15:12
esp32-c3 wifi - debug output
I (3121) esp_idf_svc::wifi: Setting STA interface configuration: InterfaceConfiguration { key: "WIFI_STA_DEF", description: "sta", route_priority: 100, ip_configuration: Client(DHCP(DHCPClientSettings { hostname: None })), interface_stack: Sta }
I (3141) esp_idf_svc::wifi: STA IP configuration done
I (3141) esp_idf_svc::wifi: STA configuration done
I (3151) esp_idf_svc::wifi: Starting with status: Status(Starting, Stopped)
I (3161) esp_idf_svc::wifi: Status is of operating type, starting
I (3161) wifi:mode : sta (60:55:f9:c0:1f:c0)
I (3171) wifi:enable tsf
I (3171) esp_idf_svc::wifi: Start requested
I (3171) esp_idf_svc::wifi: STA netif status: EspNetif(EspNetifStack(PrivateData), 0x3fca4668), index: 1, name: lo0, ifkey: WIFI_STA_DEF
I (3191) esp_idf_svc::wifi: AP netif is not allocated
@amanjeev
amanjeev / gist:e9fb82c15a41875c5acf883847ad6ae6
Created January 11, 2023 16:40
rust compiler tests commands shenanigans
dependency -
command: "/home/aj/proj/rust/rustcompiler/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/aj/proj/rust/rustcompiler/rust/src/test/ui/auxiliary/const_mut_refs_crate.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home/aj/proj/rust/rustcompiler/rust/build/x86_64-unknown-linux-gnu/test/ui/const-mut-refs-crate/auxiliary" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/aj/proj/rust/rustcompiler/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--crate-type" "dylib" "-L" "/home/aj/proj/rust/rustcompiler/rust/build/x86_64-unknown-linux-gnu/test/ui/const-mut-refs-crate/auxiliary"
extras -
"-Lnative=/home/aj/proj/rust/rustcompiler/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" \
-C incremental=/home/aj/proj/rust/rustcompiler/const-ref-issue-57349/local/target/debug/incremental \
"--crate-type"