Skip to content

Instantly share code, notes, and snippets.

View rescenic's full-sized avatar
🌏
DevOps Engineer

Muhammad Ridwan Hakim rescenic

🌏
DevOps Engineer
View GitHub Profile
@vilicvane
vilicvane / wsl-host.ps1
Last active December 3, 2022 06:25
Access Windows host from WSL 2
# Access host ports from WSL 2.
# https://gist.github.com/vilic/0edcb3bec10339a3b633bc9305faa8b5
# Make sure WSL gets initialized.
bash.exe -c exit
# Record host name for /etc/hosts that points to host IP.
$HOST_NAME = "host.wsl";
# Ports listened on host localhost to forward, you don't need to add the port if it listens all addresses.
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active June 12, 2024 12:33
Building a react native app in WSL2
@unsafe9
unsafe9 / wsl-ssh-install.sh
Last active April 21, 2020 04:18
wsl-ssh
sudo apt update
sudo apt upgrade
sudo apt-get purge openssh-server
sudo apt-get install openssh-server
sudo service ssh start
@fworks
fworks / install-zsh-windows-git-bash.md
Last active May 21, 2024 05:32
Zsh / Oh-my-zsh on Windows Git Bash
@bhaveshdaswani93
bhaveshdaswani93 / composition_vs_inheritance.js
Created January 4, 2020 08:54
composition vs inheritance explained by example
// we have to represent human relation in oop style
class Human {
constructor(firstName,lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
sleepNow() {
console.log(`${this.firstName} ${this.lastName} is sleeping`)
}
@bhaveshdaswani93
bhaveshdaswani93 / oop_classes.js
Created December 22, 2019 06:00
Understanding classes in javascript
class Person
{
constructor(first_name,last_name) {
this.first_name = first_name;
this.last_name = last_name;
}
getFullName() {
return `Full Name is: ${this.first_name} ${this.last_name}`;
}
}
@0penBrain
0penBrain / commitCount.sh
Last active May 29, 2024 00:50
The simplest way to get commit count of a GitHub repository through the API
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
### And that's all !
# I saw many fighting with finding first commit SHA or similar fancy thing.
# Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !)
# So this is robust and bandwidth efficient. :)
# If one want the commit count of a specific SHA, just use :
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
@pishangujeniya
pishangujeniya / reset-mysql-8-root-password-windows.md
Created December 5, 2019 18:04
Reset MySQL 8.0 root Password in Windows

Reset MySQL 8.0 root Password in Windows

  1. Stop the MySQL 8.0service from services
  2. Go to path C:\Program Files\MySQL\MySQL Server 8.0\bin and open cmd
  3. Run mysqld --console --skip-grant-tables --shared-memory
  4. Open new cmd in the same path
  5. Run following commands
  6. mysql -u root
  7. select authentication_string,host from mysql.user where user='root';
  8. UPDATE mysql.user SET authentication_string='' WHERE user='root';
@danieldogeanu
danieldogeanu / WampSendmail.md
Created November 22, 2019 17:12
How to configure Wamp Server to send email with sendmail.

1. Download and Configure Sendmail for Windows:

  • Download Sendmail for Windows;
  • Extract sendmail.zip and place the contents in an easily accessible place, like C:\sendmail;
  • Open the sendmail.ini file using a text editor such as notepad and edit the following values:
    [sendmail]
    smtp_server=mail.example.com
    smtp_port=465
    auth_username=username@example.com
    

auth_password=your_password