Skip to content

Instantly share code, notes, and snippets.

View p4prawin's full-sized avatar

Pravin Mane p4prawin

View GitHub Profile
@p4prawin
p4prawin / Setup Pgadmin4 docker.md
Created February 28, 2024 13:32 — forked from tcoupin/Setup Pgadmin4 docker.md
Setup Pgadmin4 docker

Just run:

curl https://gist.githubusercontent.com/tcoupin/af82bbbf5de516d186c1f2170ae5d0c4/raw/setup.sh | bash

Notes:

  • on close, the container is not close.
  • default email : admin@admin.admin, default password admin
  • a volume named "pgadmin" is create to store config
Chrome: Requestly
Firefox: Request Control
ISSUE:
windows rdp to Ubuntu 16.04 Virtual machine
blank screen after login
immidiate exit after login
Frozen screen
Issue with remote machine (ubuntu) display
SOLUTION:
# cp /usr/share/lightdm/lightdm.conf.d/60-gnome.conf /etc/lightdm/lightdm.conf.d/
ISSUE:
# nginx -t
nginx: [emerg] BIO_new_file("/etc/ssl/certs/dhparam.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/ssl/certs/dhparam.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
SOLUTION:
# mkdir -p /etc/ssl/certs/
# openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048;
# /etc/init.d/nginx start
function validate_email($email) {
$email_matches = array();
$from_regex = '[a-zA-Z0-9_,\s\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
$user_regex = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
$domain_regex = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.?)+';
$ipv4_regex = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
$ipv6_regex = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';
preg_match("/^$from_regex\s\<(($user_regex)@($domain_regex|(\[($ipv4_regex|$ipv6_regex)\])))\>$/", $email, $matches_2822);
@p4prawin
p4prawin / findPrimeNumbers.js
Last active December 18, 2015 04:49
simple javacript function to find Prime Numbers between 0 to given number
/*
author : Pravin Mane.
sr. digital technologist @ExperienceCommerce Pvt. Ltd.
Live Demo:
http://jsfiddle.net/p4prawin/YS8M5/10/
*/
function getPrimeNumbers(tillVal) {
var findTill = tillVal;