Skip to content

Instantly share code, notes, and snippets.

View sar's full-sized avatar

Sar Malik sar

View GitHub Profile
@sar
sar / page_curl.sh
Created December 8, 2020 06:28
Iterates cURL HTTP GET requests to uri nth times; replicate thread for DDoS testing
#!/bin/bash
read -p "Enter direct URL for cURL page loop: " url
read -p "Max loop iterations: " iter
counter=1
while [ $counter -le $iter ]
do
echo $counter
# curl domain
@sar
sar / xrandr_merge_displays.sh
Created January 3, 2021 00:54
Merge display outputs using xrandr like EyeFinity or NVIDIA Surround on Linux
#!/bin/bash
xrandr
xrandr --setmonitor Merged auto DP-4,HDMI-0
set +x
@sar
sar / netdiag.sh
Last active January 12, 2021 06:36
Emit diagnostics for all open network connections on Linux systems
#!/bin/sh
# network:devices:bound ip
ip addr
# ports:open:bound program/pid
netstat -tunlp
# active:network:connections:program
netstat -atupen | grep ESTABLISHED
@sar
sar / virsh-performance-tweaks.md
Created January 15, 2021 18:54
Improve libvirsh kvm performance by tweaking CPU, GPU, and Disk

KVM (Virsh) Performance Tweaking

VirtIO GPU

    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
@sar
sar / typescriptreact.json
Created February 10, 2021 02:23
VS Code Snippets for React Class Components in TypeScript
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
$ npm login --scope=@OWNER --registry=https://npm.pkg.github.com

> Username: USERNAME
> Password: TOKEN
> Email: PUBLIC-EMAIL-ADDRESS
@sar
sar / eslint-prettier-typescript-config.md
Last active February 26, 2021 19:54 — forked from carsenchan/setup.md
Eslint + Prettier for React Typescript

Project setup

Purpose

To ensure that the coding style is consisitent in the project from different members, for React + Typescript projects, it is recommanded set up ESlint and Prettier.

  1. Install the required dev dependencies:
yarn add eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react -D
@sar
sar / redshift.conf
Last active March 1, 2021 00:14
Fedora Redshift config file, place in ~/.config/redshift.conf
[redshift]
temp-day=6500
temp-night=3700
gamma=1.25
location-provider=manual
[manual]
lat=43.7
lon=79.4
@sar
sar / firefox.webgpu.md
Created March 14, 2021 00:44
Enable Web GPU Video Decoding and DOM Acceleration on Firefox Linux

Firefox GPU Acceleration

Enable GPU accelerated content decoding and DOM compositor rendering on Linux. For more details refer to docs.

Properties can be set by navigating to about:config.

DOM

gfx.webrender.all=true
layers.mlgpu.enabled=true
@sar
sar / page_curl.sh
Created March 14, 2021 00:48
cURL webpage n-loops for Chaos Testing, DDoS, and Analytics Spiking
#!/bin/bash
# ----------------------
# cURL webpage n-iters useful for Chaos Testing, DDoS, Analytics Spiking
# Author github@sar assumes no responsibility for your actions
# ----------------------
read -p "Enter direct URL for cURL page loop: " url
read -p "Max loop iterations: " iter
counter=1