Skip to content

Instantly share code, notes, and snippets.

💤
Slow to respond

Ankur Kumar ankurk91

💤
Slow to respond
View GitHub Profile
View postgresql-ubuntu.md

PostgreSQL on Ubuntu 18.04

Add PPA Source

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" >> /etc/apt/sources.list.d/pgdg.list.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update

Install

@ankurk91
ankurk91 / laravel_horizon.md
Last active Jul 9, 2020
Laravel Horizon, redis-server, supervisord on Ubuntu server
View laravel_horizon.md

Laravel Horizon, redis-server, supervisord on Ubuntu 16/18 server

Laravel 7.0, Horizon 4.x, Redis 5.x

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now it should show status as inactive on dashbaord

Install redis-server

View boot-from-iso.md

Grub Boot from ISO

  • You can force grub to boot from an ISO file that is located on your hard disk

Sample file entry

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
@ankurk91
ankurk91 / 1-elementary-os-apps.md
Last active Jul 6, 2020
elementary OS 5.1 Hera
View 1-elementary-os-apps.md

elementaryOS Apps and Configs

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common

Install original plank dock

@ankurk91
ankurk91 / mac-apps.md
Last active May 19, 2020
Mac OS 10.15 Apps and configs
View mac-apps.md

macOS Apps

Homebrew

# Install x-code command line tools 
xcode-select --install

# Install homebrew iteself
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@ankurk91
ankurk91 / axios-dev-interceptors.js
Last active Jun 3, 2020
axios logger (Interceptors)
View axios-dev-interceptors.js
// axios development only interceptors
// https://github.com/mzabriskie/axios#interceptors
/**
* Strip baseURL from URL
*
* @param config Object
* @returns String
*/
function getUrl(config) {
@ankurk91
ankurk91 / bash_profile.md
Last active Jun 24, 2020
:octocat: Git branch name in Linux/Mac Bash Terminal
View bash_profile.md

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@ankurk91
ankurk91 / github_gpg_key.md
Last active Jul 10, 2020
Github : Signing commits using GPG (Ubuntu/Mac)
View github_gpg_key.md

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@ankurk91
ankurk91 / xdebug-mac.md
Last active Jul 8, 2020
php xDebug on Ubuntu/Mac and phpStorm 2019
View xdebug-mac.md

🐞 Install and Configure xDebug on MacOS for PhpStorm 🐘

⚠️ This guide only applies to Homebrew v1.6+

  • Check your version brew --version before proceeding

  • Assuming that you have already installed php and apache via Homebrew v1.6+

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache
@ankurk91
ankurk91 / install_lamp_18.sh
Last active Jul 10, 2020
Ubuntu 18.04 - PHP development (php 7.4, MySQL 5.7, apache 2.4)
View install_lamp_18.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
You can’t perform that action at this time.