Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Back on track, yayyyy!

Hasin Hayder hasinhayder

🚀
Back on track, yayyyy!
View GitHub Profile
View all-packages-restore.md

https://askubuntu.com/posts/9889/edit

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
hasinhayder / readme.md
Created Jan 26, 2022
Remove Grub Bootloader From Windows
View readme.md

Remove Boot Loader EFI / System Partion in Windows 10

Quick Guide

Open PowerShell as Administrator

mountvol S: /S
S:
cd .\EFI\

dir

@hasinhayder
hasinhayder / jquery.md
Created Jan 26, 2022
Import jQuery in ESM
View jquery.md

You can create a module converter like below:

// jquery.module.js
import 'https://code.jquery.com/jquery-3.6.0.min.js'
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
hasinhayder / script.sh
Created Jan 8, 2022
Mechanical Keyboard Key Not Repeating Problem Fixed in Mac
View script.sh
defaults write -g ApplePressAndHoldEnabled -bool false
View mousewheel.sh
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# 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
hasinhayder / mutate.html
Created Oct 11, 2021
Mutate AlpineJS Object's Data in Different Ways
View mutate.html
<html>
<head>
<title>Mutating AlpineJS Object Data</title>
</head>
<body>
<button onclick="changeDataByDispatchingEvent()">Mutate Alpine Object's Data Using Event</button>
<br>
<br>
View WP SmartPay - bKash Gateway
<?php
/**
* WP SmartPay - bKash Gateway
*
* Plugin Name: WP SmartPay - bKash Gateway
* Plugin URI: https://wpsmartpay.com/
* 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
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
hasinhayder / README.md
Created Apr 8, 2021 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server
View README.md

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