Skip to content

Instantly share code, notes, and snippets.

View manniru's full-sized avatar

MUHAMMAD MANNIR AHMAD manniru

View GitHub Profile
@manniru
manniru / sphp.sh
Created March 25, 2023 05:56 — forked from rhukster/sphp.sh
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@manniru
manniru / 1. Building PHP-MAMP on Apple Silicon M1.md
Created March 25, 2023 05:47 — forked from lennardv2/1. Building PHP-MAMP on Apple Silicon M1.md
Native PHP development / MAMP stack on Apple silicon M1

Building the MAMP stack (php, apache & mysql) on Apple Silicon ARM (native)

Update! This tutorial is outdated. Nowadays brew installes m1 binaries just fine. Also use valet: https://laravel.com/docs/9.x/valet. It's 10x easier.

In this tutorial, we'll build the the nescessary packages for ARM via homebrew. After that we'll configure apache2 for using virtual hosts. The native php is ofcourse way faster, see the results of this benchmark below.

TEST NAME SECONDS OP/SEC
@manniru
manniru / IPTV-big-list.m3u
Created January 14, 2023 09:07 — forked from tunks/IPTV-big-list.m3u
IPTV big list.m3u
#EXTM3U
#EXTINF:-1,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:0,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:-1,UNIVISION
http://iphone-streaming.ustream.tv/ustreamVideo/21680354/streams/live/playlist.m3u8
#EXTINF:0,UNIVISION 1
export default (req, res) => res.status(200).json({ time: +new Date() })
@manniru
manniru / server.js
Created December 26, 2022 10:13
write simple nodejs server that display all requests data in console
const http = require('http')
const server = http.createServer((req, res) => {
console.log(`Method: ${req.method}`)
console.log(`URL: ${req.url}`)
console.log(`Headers: ${JSON.stringify(req.headers)}`)
req.on('data', chunk => {
console.log(`Body: ${chunk}`)
})
@manniru
manniru / client.js
Created December 23, 2022 19:53
Socket Client Server with Heart Beat
const net = require("net");
const client = net.createConnection({ port: 8000 }, () => {
console.log("Connected to server");
});
client.on("data", (data) => {
console.log(`Received: ${data.toString()}`);
});
@manniru
manniru / Win10-64bit-npm.md
Created December 23, 2022 19:44 — forked from jtrefry/Win10-64bit-npm.md
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
#!/bin/bash
adb shell settings put secure show_rotation_suggestions 0
adb shell pm disable-user --user 0 com.samsung.android.calendar
adb shell pm disable-user --user 0 com.appstar.callrecorder
adb shell pm disable-user --user 0 kr.go.nema.disasteralert_new
adb shell pm disable-user --user 0 com.samsung.android.game.gamehome
adb shell pm disable-user --user 0 com.samsung.android.aircommandmanager
adb shell pm disable-user --user 0 com.samsung.android.messaging
@manniru
manniru / ddg.sh
Created December 19, 2022 23:22 — forked from j0nk0/ddg.sh
ddg.sh - Search the internet with DuckDuckGo from your terminal
#!/bin/sh
# ddg.sh - Search the internet with DuckDuckGo from your terminal
# Made with boredom, on Christmas Eve, by mftrhu
# Requirements:
# awk, curl OR wget, sed, head, tail, grep, tput (MAYBE)
available () {
command -v "$1" >/dev/null 2>&1
}
@manniru
manniru / ipwebcam.sh
Created December 19, 2022 23:17 — forked from imneonizer/ipwebcam.sh
Using Android as HD webcam
#!/bin/bash
export ANDROID_SERIAL=`adb devices -l | grep -i oneplus | awk '{print $1}'`
export HOST_PORT=8080
export IPWEBCAM_PORT=8080
export V4L2_DEVICE=/dev/video0
function start_screen_mirror(){
if [ ! `pgrep scrcpy` ];then