Skip to content

Instantly share code, notes, and snippets.

Back on track, yayyyy!

Hasin Hayder hasinhayder

Back on track, yayyyy!
View GitHub Profile

How to keep a list of all packages and restore using dpkg

  1. It'd be a good idea to just copy all of /home as that contains your documents and preferences. If you just want to know where preferences are stored, it varies. Many applications store them in .config (that's /home/username/.config) and .local. Most user preferences will be in .gconf. Some older applications might save settings in .gnome2. Firefox uses .mozilla; other browsers use .config as far as I know. To be safe, I'd just recommend backing up /home still.

  2. Run dpkg --get-selections > ~/my-packages.txt to build up a list of everything installed (or removed) on your system. It will be saved in your home folder as my-packages.txt. Once you reinstall, run sudo dpkg --set-selections < ~/my-packages.txt (assuming the file is placed in the same location again) and then sudo apt-get -u dselect-upgrade to start installing packages. You'll want to also back up /etc/apt/ and restore it

hasinhayder /
Created Jan 26, 2022
Remove Grub Bootloader From Windows

Remove Boot Loader EFI / System Partion in Windows 10

Quick Guide

Open PowerShell as Administrator

mountvol S: /S
cd .\EFI\


hasinhayder /
Created Jan 26, 2022
Import jQuery in ESM

You can create a module converter like below:

// jquery.module.js
import ''
export default window.jQuery.noConflict(true)

This will remove global variables introduced by jQuery and export jQuery object as default.

Then use it in your script:

hasinhayder /
Created Jan 8, 2022
Mechanical Keyboard Key Not Repeating Problem Fixed in Mac
defaults write -g ApplePressAndHoldEnabled -bool false
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
hasinhayder / mutate.html
Created Oct 11, 2021
Mutate AlpineJS Object's Data in Different Ways
View mutate.html
<title>Mutating AlpineJS Object Data</title>
<button onclick="changeDataByDispatchingEvent()">Mutate Alpine Object's Data Using Event</button>
View WP SmartPay - bKash Gateway
* WP SmartPay - bKash Gateway
* Plugin Name: WP SmartPay - bKash Gateway
* Plugin URI:
* Description:
* Tags: bKash
* Version: 0.1
View flex-grid.css
.flex-grid {
display: flex;
flex-flow: wrap;
.col-1 {flex: 0 0 8.3333%}
.col-2 {flex: 0 0 16.6666%}
.col-3 {flex: 0 0 25%}
.col-4 {flex: 0 0 33.3333333%}
.col-5 {flex: 0 0 41.6666%}
hasinhayder / toUTF8Array.js
Created Apr 11, 2021 — forked from joni/toUTF8Array.js
toUTF8Array: Javascript function for encoding a string in UTF8.
View toUTF8Array.js
function toUTF8Array(str) {
var utf8 = [];
for (var i=0; i < str.length; i++) {
var charcode = str.charCodeAt(i);
if (charcode < 0x80) utf8.push(charcode);
else if (charcode < 0x800) {
utf8.push(0xc0 | (charcode >> 6),
0x80 | (charcode & 0x3f));
else if (charcode < 0xd800 || charcode >= 0xe000) {
hasinhayder /
Created Apr 8, 2021 — forked from mrbar42/
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster