Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mfgbhatti on github.
  • I am mfgbhatti (https://keybase.io/mfgbhatti) on keybase.
  • I have a public key ASCneq3R3nH7LFgCpgCdD_ZVmXnn5Xbdz9FDwfY98Ch_ngo

To claim this, I am signing this object:

@mfgbhatti
mfgbhatti / getwallpapers.sh
Created September 30, 2022 10:33 — forked from giventofly/getwallpapers.sh
wget unsplash wallpapers
#!/bin/bash
for i in {1..25}; do wget https://source.unsplash.com/featured/1920x1080/\?dogs -O "$(ls -l | wc -l).jpg" && sleep 2; done

##digitalocean console

  1. Copy the console URL and paste it to a new window. ex. https://cloud.digitalocean.com/droplets/111111111/console?no_layout=true.
  2. Open Developer Tools then click Console tab
  3. Copy and paste the codes below. Taken from stackoverflow
var sendString = (function(rfb, force, sendDelay) { 
  sendDelay = sendDelay || 25;
  var _q = [];
  var _qStart = function() {
#!/usr/bin/env bash
# Function
installpkg(){ pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;}
# Variables
MOUNTPOINT="/mnt"
BOOT_PARTITION="/dev/sda1"
ROOT_PARTITION="/dev/sda2"
USERNAME="farhan"
ISO="GB"
DISK="/dev/sda"
@mfgbhatti
mfgbhatti / MOTD.md
Last active February 11, 2024 05:03
Ubuntu like motd for arch linux systems
#!/usr/bin/env bash
# ____ __ __ __ __ _
# ____ ___ / __/___ _/ /_ / /_ ____ _/ /_/ /_(_)
# / __ `__ \/ /_/ __ `/ __ \/ __ \/ __ `/ __/ __/ /
# / / / / / / __/ /_/ / /_/ / / / / /_/ / /_/ /_/ /
#/_/ /_/ /_/_/ \__, /_.___/_/ /_/\__,_/\__/\__/_/
# /____/
#
# https://gist.github.com/mfgbhatti/2c2ea5da5d6d7e608d90fd43d4daa4a8
@mfgbhatti
mfgbhatti / iwlwifi.md
Last active April 3, 2022 20:38
iwlwifi Failed to run INIT ucode: -110

This happened because somehow kernel is loading wrong version for iwlwifi

loaded firmware version: 66.f1c864e0.0 ty-a0-gf-a0-66.ucode

needed to do

sudo mv /usr/lib/firmware/iwlwifi-ty-a0-gf-a0-66.ucode.xz /usr/lib/firmware/iwlwifi-ty-a0-gf-a0-66.ucode.BACK sudo reboot

@mfgbhatti
mfgbhatti / kernel.md
Last active April 17, 2023 15:07
find installed kernel and update grub

also leave one more kernel as fallback

dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | sed -n '/linux-image second last/q' | xargs sudo apt-get -y purge

update grub after this

sudo update-grub