Skip to content

Instantly share code, notes, and snippets.

View gurindersingh's full-sized avatar

Gurinder Chauhan gurindersingh

View GitHub Profile
#!/bin/bash
export LDFLAGS=-Wl,-rpath=/var/task/lib/
export PKG_CONFIG_PATH='/canvas/lib/pkgconfig'
export LD_LIBRARY_PATH='/canvas/lib':$LD_LIBRARY_PATH
C_INCLUDE_PATH=/canvas/include/
CPLUS_INCLUDE_PATH=/canvas/include/
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
@gurindersingh
gurindersingh / php-get-remote-image-dimensions-curl
Created July 1, 2020 13:44 — forked from ontiuk/php-get-remote-image-dimensions-curl
Get Remote Image Dimensions With PHP and cURL - GetImageSize Alternative
<?php
/** 
* Retrieve remote image dimensions 
* - getimagesize alternative 
*/
/**
* Get Image Size 
@gurindersingh
gurindersingh / postgres-brew.md
Created May 4, 2020 20:52 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@gurindersingh
gurindersingh / postgres-brew.md
Created May 4, 2020 20:50 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX) (outdated see top most note)

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
@gurindersingh
gurindersingh / AuthServiceProvider.php
Created March 27, 2019 02:14 — forked from ralphschindler/AuthServiceProvider.php
Laravel 5.8 Policy Guesser For Using "Models" Directory
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**
@gurindersingh
gurindersingh / generate-ssh-key.sh
Created January 25, 2019 11:44 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@gurindersingh
gurindersingh / rules-both.iptables
Created November 7, 2018 01:32 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@gurindersingh
gurindersingh / iptables_rules.sh
Created November 7, 2018 01:32 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@gurindersingh
gurindersingh / meta-tags.md
Created June 24, 2018 20:05 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@gurindersingh
gurindersingh / html-head-boilerplate.html
Created February 20, 2018 08:33 — forked from nunosans/html-head-boilerplate.html
HTML Head Boilerplate & Reference
<!doctype html>
<html>
<head>
<!-- Priority tags. These must come first. -->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge; chrome=1"> <!-- Render Chrome if available or using latest version of Internet Explorer (Recommended). -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- Document Title -->
<title>Page Title</title>
<!-- Allows control over where resources are loaded from. Place as early in the document as possible, only applies to content below this tag. -->