Skip to content

Instantly share code, notes, and snippets.

View darkmastermindz's full-sized avatar
👋
Making an Impact on Millions of Lives. #CodeForGood

Hansel Wei darkmastermindz

👋
Making an Impact on Millions of Lives. #CodeForGood
  • Senior Software Developer working @ Ally; Former officer for @UNCCGameDevelopers; Volunteering for various Non-Profit / Educational Orgs; Nerd and Geek Alliance Group
  • Charlotte, NC - United States (GMT-5)
  • LinkedIn in/hanselwei
View GitHub Profile
@kumarharsh
kumarharsh / system-environment-snippets
Last active June 18, 2021 17:05
[Powershell] Update Environment Variable one-liner
# These snippets provide a quick way to update your environment variables
# directly from your powershell console. Just copy paste these lines, or
# even better, add it to your profile as functions.
# refreshing env in current shell
$env:path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
# adding path to env
# set path in the $_newPath variable, and it'll get set to your user environment path and persisted.
$_newPath=""; [System.Environment]::SetEnvironmentVariable("Path", [System.Environment]::GetEnvironmentVariable("Path", "User") + ";${_newPath}", "User")
@levelsio
levelsio / blunble.php
Last active August 5, 2022 06:24
Blunble Bot for Twitter
<?
//
// BLUNBLE BOT (by @levelsio)
//
// "Blunble" is Korean internet slang for [BL]ock [UNBL]ock
// If you block and unblock somebody on Twitter, they stop following you.
// It's a polite way of getting rid of trolls without permanently blocking
// because blocking usually results in more anger and more trolling.
//
// WHAT THIS SCRIPT DOES:
Assuming you have followed all the steps to install / setup WSL2 -> https://docs.microsoft.com/en-us/windows/wsl/install-win10
**Tested on Ubuntu 20.04**
Step 1 - Find out default gateway and DNS servers
- Navigate to `Control Panel\Network and Internet\Network Connections`
- Right click on relevant connection type WiFi or Ethernet and select `Status`
- Status screen will be displayed, click on `Details` button
- Network Connection details screen will be displayed
- Note down `IPv4 default gateway` and `IPv4 DNS Servers` if available
@plembo
plembo / wgetforwin.md
Last active June 28, 2024 03:39
wget for Windows

Getting wget for Windows

For most of the Unix-like work I do on Windows, the small set of utilities provided by Git for Windows suffice. But just yesterday I found myself needing wget to complete a small (Windows) shell script I wanted to write.

In my search for a solution I finally took a closer look at the Git for Windows SDK, and lo! found it includes a wget binary for Windows.

There are a few ways I could have gone with this. The "right" way would have been to replace my existing install with a recompiled Git for Windows. But I wasn't going to exert that kind of effort to get a single utility. What I did instead was install wget for the SDK and then copy it and its one dependency to where I had Git installed.

First install the SDK and open its shell (msys1_shell.cmd). Then install wget using pacman(pacman -Sy wget).

Next, open a Windows terminal as Admin and copy the wget executable and