Skip to content

Instantly share code, notes, and snippets.

View bhagatparwinder's full-sized avatar
♥️
Happy, cheerful & confident!

Parwinder Bhagat bhagatparwinder

♥️
Happy, cheerful & confident!
View GitHub Profile
@bhagatparwinder
bhagatparwinder / bootable-windows.md
Created November 23, 2023 18:22
Create bootable Windows USB on Mac
  • Download/Mount the ISO from Microsoft: https://www.microsoft.com/software-download/windows11
  • List your drives: diskutil list
  • Format drive: diskutil eraseDisk MS-DOS WINDOWS GPT /dev/diskX (replace diskX with your disk identifier)
  • Copy all files from ISO excluding install.wim (too big for FAT32)
    • rsync -vha --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS
  • Install wimlib to split install.wim brew install wimlib
    • wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WINDOWS/sources/install.swm 3500
    • Split size could be anything under 4GB
  • Profit 🤑
@bhagatparwinder
bhagatparwinder / Mail.plist
Created April 21, 2023 15:34
Turn off link preview in macOS Mail
<!--
Save this plist as /Library/Preferences/FeatureFlags/Domain/Mail.plist and reboot. You can opt for terminal command instead:
sudo defaults write /Library/Preferences/FeatureFlags/Domain/Mail.plist RichLinks -dict-add Enabled -bool NO ;
sudo chmod -R o+rX /Library/Preferences/FeatureFlags
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
@bhagatparwinder
bhagatparwinder / fangxiao-domains-pihole-blocklist-11-2022
Created November 19, 2022 18:03 — forked from leviem1/fangxiao-domains-pihole-blocklist-11-2022
PiHole blocklist for phishing domains used by Fangxiao: bleepingcomputer.com/news/security/42-000-sites-used-to-trap-users-in-brand-impersonation-scheme/
This file has been truncated, but you can view the full file.
0.0.0.0 002sen.cn
0.0.0.0 003bty.cyou
0.0.0.0 005nj7z.cn
0.0.0.0 006ks4g.cn
0.0.0.0 0072875.xyz
0.0.0.0 0099q7e.cn
0.0.0.0 009gfy.cyou
0.0.0.0 00ckpr.cn
0.0.0.0 00cojpj.cn
0.0.0.0 00cvl.cn
@bhagatparwinder
bhagatparwinder / delete.md
Created June 14, 2022 19:07 — forked from timwco/delete.md
LinkedIn: Delete Messages (June 2022)

What

LinkedIn is a valuable resource, but sometimes it sucks. One of those times is when you want to delete messages. You have to select each message one by one. It takes about 4 "clicks" to successfully delete a message.

This script should help. Since LI requires you to perform multiple steps, I decided to automate it for you. Once you initiate the script, it will run every second. If a message has the ability to be deleted, it will be. If not, it will be archived. Some "InMail" messages cannot be deleted on the web app. This script should work as long as LI doesn't change their page layout or element names, which happens often.

Last tested & verified working on: June, 10, 2022

Special Thanks to @noncent for the updated script.

@bhagatparwinder
bhagatparwinder / scanner.sh
Created April 20, 2022 14:29 — forked from andyrbell/scanner.sh
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@bhagatparwinder
bhagatparwinder / validate_credit_card.js
Created May 28, 2021 15:51 — forked from DiegoSalazar/validate_credit_card.js
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@bhagatparwinder
bhagatparwinder / debloat.txt
Created May 25, 2021 04:23
Android/Samsung Bloatware
pm uninstall -k --user 0 com.android.providers.partnerbookmarks
pm uninstall -k --user 0 com.facebook.appmanager
pm uninstall -k --user 0 com.facebook.katana
pm uninstall -k --user 0 com.facebook.services
pm uninstall -k --user 0 com.facebook.system
pm uninstall -k --user 0 com.google.android.partnersetup
pm uninstall -k --user 0 com.google.ar.core
pm uninstall -k --user 0 com.microsoft.appmanager
pm uninstall -k --user 0 com.microsoft.skydrive
pm uninstall -k --user 0 com.netflix.mediaclient
{
"Set Local Environment Vars" : true,
"Working Directory" : "\/Users\/Parwinder",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 0.70916998386383057,
"Red Component" : 0.70916998386383057,
"Blue Component" : 0.70916998386383057
},
"Rows" : 45,
@bhagatparwinder
bhagatparwinder / settings.json
Created June 19, 2020 05:41
VS Code Settings
{
"autoimport.doubleQuotes": true,
"breadcrumbs.enabled": true,
"css.lint.important": "warning",
"debug.node.autoAttach": "on",
"debug.toolBarLocation": "docked",
"editor.codeLens": false,
"editor.colorDecorators": true,
"editor.cursorBlinking": "phase",
"editor.cursorStyle": "line",
@bhagatparwinder
bhagatparwinder / extensions
Created June 19, 2020 05:25
VS Code Extensions
code --install-extension Angular.ng-template
code --install-extension CoenraadS.bracket-pair-colorizer
code --install-extension IBM.output-colorizer
code --install-extension Tyriar.sort-lines
code --install-extension WallabyJs.quokka-vscode
code --install-extension adamwalzer.string-converter
code --install-extension alexkrechik.cucumberautocomplete
code --install-extension Arjun.swagger-viewer
code --install-extension atlassian.atlascode
code --install-extension auchenberg.vscode-browser-preview