Skip to content

Instantly share code, notes, and snippets.

View nk-gears's full-sized avatar
💥
experimenting...

Nirmal nk-gears

💥
experimenting...
View GitHub Profile
@Voles
Voles / bump-patch.sh
Last active August 20, 2020 10:10
Bump patch file and push to origin
#!/usr/bin/env bash
bp () {
git fetch
latestTag=$(git tag | tail -n1)
versionParts=($(echo "$latestTag" | tr '.' '\n'))
newTag="${versionParts[1]}.${versionParts[2]}.$(($versionParts[3] + 1))"
echo "new patch version is: $newTag"
@jap
jap / doorbell.yaml
Last active June 16, 2023 00:32
esphome powered imperial march doorbell
---
# writtten by Jasper Spaans,
# based on https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/
esphome:
name: doorbell_v2
platform: ESP8266
board: esp01
# WiFi connection, correct these
# with values for your WiFi.
wifi:
@markodvornik
markodvornik / Hack-WD-MCHD.md
Last active February 15, 2024 12:18
How to hack the "WD My Cloud Home Duo" into a decent home media center

WD My Cloud Home Duo Hack

🚩 NOTE: in late 2022 WD introduced a firmware release in which they locked root user access over "serial connection". The methods described in this post are therefore irrelevant and do not work anymore. Feel free to discus other alternatives in the comments below. This was also the final firmware release for this product as it entered EOL in June 2023.

TL;DR

A simple How-To on turnning your WD My Cloud Home in to fully pledged Linux box and install some usefull apps (SSH & SFTP server, Torrent client, ...).

  • Connect to the device with USB serial cable.
@rmiyazaki6499
rmiyazaki6499 / deploy-mern.md
Last active February 24, 2024 05:44
Deploying a Production ready React-Express app on AWS EC2 with CI/CD

Deploying a Production ready React-Express app on AWS

In this tutorial, I will be going over to how to deploy a Javascript app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app AlgoAcademy (a resource for reviewing algorithms and data structures) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • A React frontend, Express backend
  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
#! /usr/bin/env python3
stream_key = 'xxxx-xxxx-xxxx-xxxx'
recording_path = '/home/username/Videos'
ffmpeg_path = ''
print("If you haven't started the recording already, press Ctrl-c to cancel this...")
from datetime import datetime
from pathlib import Path
import os
@sjlu
sjlu / Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js.md
Last active September 12, 2023 08:56
Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js

This file is a log of everything I've encountered when trying to migrate a Node.js, Elastic Beanstalk application from the Amazon Linux platform to the Amazon Liunx 2 platform. Here's why you should migrate:

  1. LTS support up to 2023 source
  2. The Amazon Linux AMI's end-of-life is December, 2020 source
  3. Amazon Linux 2 has some big package upgrades (GCC, Glibc, etc.)
  4. Elastic Beanstalk also has some upgrades on top of Amazon Linux 2 (e.g. faster deploys)

Challenges

Disabling NPM install

@mooz
mooz / change_video_playback_speed_ios.md
Last active October 15, 2021 04:19
Bookmarklet for changing video playback speed on iPad/iPhone

Installation

In your browser (e.g., Safari),

  1. Add a dummy bookmark and name it Change playback speed (1.5x)
  2. Change the URL of the bookmark to javascript:(function()%7Bvar%20video%20%3D%20document.querySelector(%22video%22)%3B%20if%20(video)%20%7B%20video.playbackRate%20%3D%201.5%3B%20%7D%7D)()

Usage

On website playing a video, click 1.5x in your bookmarks.

function signUpMember(response, cus, lastFour, brand, sourceData, referrer, donationValue) {
wixUsers.register($w("#email").value, $w("#password").value, {
"contactInfo": {
"firstName": $w("#fName").value,
"lastName": $w("#lName").value
}
})
.then( (result) => {
$w("#processorText").text = 'Thank you for your patience, We are almost done';
updateStageOne(response, cus, lastFour, brand, sourceData, referrer, donationValue);
@SteveSandersonMS
SteveSandersonMS / Index.razor
Created February 20, 2020 14:24
Blazor WebAssembly use of ClientWebSocket
@page "/"
@using System.Net.WebSockets
@using System.Text
@using System.Threading
@implements IDisposable
<h1>Echo test</h1>
<h3>State: @webSocket.State</h3>
@if (webSocket.State == WebSocketState.Open)
@MrHassanMurtaza
MrHassanMurtaza / install_ncdu_amazon_linux.sh
Created February 11, 2020 07:29
Install ncdu on amazon linux 2
#!/bin/bash
# install packages/dependencies for compilation
sudo yum -y install gcc make ncurses-devel
cd /tmp
# the latest version of ncdu is published here: http://dev.yorhel.nl/ncdu
# update the link below if necessary:
wget -nv http://dev.yorhel.nl/download/ncdu-1.10.tar.gz