Skip to content

Instantly share code, notes, and snippets.

View svikramjeet's full-sized avatar
🎯
Focusing

Vikramjeet Singh svikramjeet

🎯
Focusing
View GitHub Profile
.oh-my-zshell/custom/alias.zsh
# You can put files here to add functionality separated per file, which
# will be ignored by git.
# Files on the custom/ directory will be automatically loaded by the init
# script, in alphabetical order.
# For example: add yourself some shortcuts to projects you often work on.
#
# brainstormr=~/Projects/development/planetargon/brainstormr
@svikramjeet
svikramjeet / gpg.md
Last active March 2, 2023 06:18
How to setup gpg keys on windows

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@svikramjeet
svikramjeet / gist:55ab8c452519d250b387131e07a66fd5
Created January 18, 2023 05:44
truncate all table in database (public scheme default) postgres
#!/bin/bash
host=127.0.0.1
user='postgres'
database='test'
PGPASSWORD='' psql -h $host -U $user $database --tuples-only --command "SELECT 'TRUNCATE TABLE ' || schemaname || '.' || tablename || ';' FROM pg_tables WHERE schemaname in ('public', 'test');" |
tr "\\n" " " |
xargs -I{} psql -h $host -U $user $database --command "{}"
@svikramjeet
svikramjeet / gist:286b5c18416470fbe70c24957b8fcb49
Created September 5, 2022 13:07
Install git , docker and docker compose on Ubuntu
Installing Git
1. sudo apt install git-all
2. git --version
Installing Docker
1. sudo apt update
2. sudo apt install apt-transport-https ca-certificates curl software-properties-common
3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
5. apt-cache policy docker-ce
@svikramjeet
svikramjeet / Readme.md
Last active November 23, 2021 12:41
Signed commit on github using gpg (ubuntu)

Open Terminal

Check exisitng keys by running gpg --list-secret-keys --keyid-format=long

If there are no GPG key pairs or you don't want to use any that are available for signing commits and tags, then generate a new GPG key.as follows

for version 2.1.17 or higher Run gpg --full-generate-key else Run gpg --default-new-key-algo rsa4096 --gen-key

Specify your option as above command will promt for several options

@svikramjeet
svikramjeet / tm
Last active April 28, 2021 09:53
<p align="center">
<a href="https://tested.me" target="_blank">
<img src="https://uat-testedme-api.herokuapp.com/images/logo.png" width="300">
</a>
</p>
------------
<p align="center">
<img src="https://img.shields.io/badge/build-passing-brightgreen" height="30">
@svikramjeet
svikramjeet / docker.txt
Created January 13, 2021 05:43
Docker basic commands
--Images
docker image prune – Remove all dangling images
docker image prune -a –all images not referenced by any container.
docker build – Builds an image from a Docker file
docker pull – Pulls an image or a repository from a registry
docker push – Pushes an image or a repository to a registry
docker commit – Creates a new image from a container’s changes
docker rmi [IMAGE] – Remove an image:
docker system prune – Purging All Unused or Dangling Images, Containers, Volumes, and Networks. Use the -f (--force) option to bypass the prompt.

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links