Skip to content

Instantly share code, notes, and snippets.

View jdecode's full-sized avatar
🦾
Automate and Chill

Jagdeep Singh Kalsi jdecode

🦾
Automate and Chill
View GitHub Profile
@jdecode
jdecode / docker-commands.md
Last active January 4, 2020 17:41
Some useful docker commands

Stop all running containers:

docker container stop $(docker container ls -aq)

Show running containers:

docker container ls -a

@jdecode
jdecode / postgre-sql-commands.md
Created March 21, 2020 18:21
PostgreSQL commands

Please note the following commands:

\list or \l: list all databases

\dt: list all tables in the current database using your search_path

\dt *.: list all tables in the current database regardless your search_path

You will never see tables in other databases, these tables aren't visible. You have to connect to the correct database to see its tables (and other objects).

@jdecode
jdecode / command-to-install-postgresql-via-docker.md
Created March 21, 2020 18:25
Install PostgreSQL on localhost using Docker

Prerequisite : Docker should be installed (Google "How to install docker") duh!

  1. docker pull postgres:latest (Pick your tag if you know)

  2. mkdir -p $HOME/docker/volumes/postgres (Ubuntu/Debian/Linux based systems)

  3. docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres

  4. You can connect using psql -h localhost -U postgres -d postgres - Password is docker (set in above command)

@jdecode
jdecode / cakephp-qaing.md
Created March 22, 2020 13:02
CakePHP setup using docker-compose, and other stuff
  1. Create migration for table sources : bin/cake bake migration CreateSources name:string status:boolean

  2. Create seeder for a table called sources : php vendor/bin/phinx seed:create --path=config/Seeds SourceSeeder

  3. Run migration and seeder : bin/cake migrations migrate and bin/cake migrations seed

@jdecode
jdecode / docker-compose-run-composer.md
Last active April 22, 2020 05:58
Run composer and other commands inside Docker using docker-compose
  1. Install composer require in docker-compose e.g. Add Sentry like this:

docker-compose run kode composer require sentry/sdk:2.1.0

  1. Run shell commands e.g. "bake" commands in CakePHP shell could be run like this:

docker-compose run kode bin/cake bake all

@jdecode
jdecode / cakue.md
Last active April 29, 2020 11:06
Install CakePHP and Vue

CakePHP + Vue Prerequisite : composer, npm, Ubuntu (same commands will run on Windows/Mac as well, if everything else is configured correctly, and you know where to run the commands).

  1. Install CakePHP composer create-project --prefer-dist cakephp/app cakue This will download and install CakePHP in the folder cakue You can call it anything, if you do not give any name, then by default folder name would be app

  2. Install Vue

@jdecode
jdecode / load-testing-using-ab.md
Last active May 1, 2020 09:54
Load testing using Apache Bench (ab)

200 simultaneous request should start to be heavy for your server, making 5K requests in total

ab -c 200 -n 5000 -r https://website.com/

@jdecode
jdecode / install-settings-manager.md
Created May 4, 2020 04:31
Ubuntu 19.10 command to restore "settings"

sudo apt-get install --reinstall gnome-control-center

@jdecode
jdecode / as-a-developer.md
Last active May 9, 2020 05:42
As a developer...

As a developer

  • I read [books, documentation, blogs...]
  • I write [code, documentation...]
  • I communicate [with colleagues, project-teams, bosses/managers...]
  • I learn [from books, w3schools, stackoverflow, youtube, tutorials, video-courses, in-office training, meetups, online-sessions...]

As a developer if someone does all of the above 4 points then that person is "at the very least" a competent developer.

When you read, write communicate and learn - you grow.

@jdecode
jdecode / cakephp-and-vue.md
Last active June 11, 2020 21:08
CakePHP and Vue in single repo

Edit: The original title of this gist was "Vue from scratch" but soon (actually from the very initial stage) it took the road of "CakePHP and Vue as monorepo". This still contains almost all the Vue specific items as listed below (the 18-point list is not changed, although some of the items are skipped or have notes added in comments). This is a fairly large piece of text + screenshots (to read and see) but not really time consuming to implement (that's what I tell myself, anyway). Happy reading.... caking and vueing... cakueing perhaps!

Thanks to github.com/pankajvashisht-ucreate for the list

Following is the original 18-point list shared by Pankaj Vashisht for someone who is starting in Vue.js from scratch

  1. Node installation
  2. Initialization of package.json file
  3. Basic understanding of script key in package.json file