Skip to content

Instantly share code, notes, and snippets.

View R-jee's full-sized avatar
🎖️
Focusing

Rana Umair R-jee

🎖️
Focusing
View GitHub Profile
apt-get update
apt-get upgrade
apt install -y nginx
systemctl enable nginx
systemctl start nginx
apt-add-repository ppa:ondrej/php -y
systemctl enable php7.4-fpm
systemclt start php7.4-fpm
apt install -y php7.4 php7.4-{cli,gd,curl,mysql,ldap,zip,fileinfo,fpm,xml,mbstring,exif,pspell,imagick,bcmath}
apt install mariadb-server mariadb-client
@R-jee
R-jee / install-ngrok-ubuntu.md
Created February 15, 2023 05:42 — forked from akamit21/install-ngrok-ubuntu.md
How to install ngrok on Ubuntu

What is ngrok?

ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyzes all traffic over the tunnel for later inspection and replay.

ngrok secure introspectable tunnels to localhost

ngrok - secure introspectable tunnels to localhost (homepage) "I want to expose a local server behind a NAT or firewall to the Internet."

Enable snapd

If you’re running Ubuntu 16.04 LTS (Xenial Xerus) or later, including Ubuntu 18.04 LTS (Bionic Beaver) and Ubuntu 20.04 LTS (Focal Fossa), you don’t need to do anything. Snap is already installed and ready to go.

/*
* Try to login, check the login credentials, and then redirect if required.
*/
login(email, password).done(function (html) {
if (html.indexOf('Invalid login credentials') !== -1) {
// invalid password - show a message to the user
} else {
// All good! Let's redirect if required
var checkoutUrl = getCheckoutUrl();
@R-jee
R-jee / getWeeksInMonth.js
Created August 16, 2022 11:25 — forked from markthiessen/getWeeksInMonth.js
JavaScript - get weeks in a month as array of start and end days
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(year, month) {
const weeks = [],
firstDate = new Date(year, month, 1),
lastDate = new Date(year, month + 1, 0),
numDays = lastDate.getDate();
let dayOfWeekCounter = firstDate.getDay();
for (let date = 1; date <= numDays; date++) {
@R-jee
R-jee / overlay.html
Last active June 10, 2022 09:55 — forked from nandoflorestan/overlay.html
jQuery: Click an image to show it big on a viewport-sized modal overlay
<html>
<head>
<title>jQuery: Click an image to show it big on a viewport-sized modal overlay
</title>
</head>
<body>
<p>
<img class="zoomable" style='width:40%;' src="http://www.tumblr.com/photo/1280/artedaalma/19707693049/1/tumblr_m19h2mwFRQ1rsn8cy" />
</p>
<p>