Skip to content

Instantly share code, notes, and snippets.

View bluetoothfx's full-sized avatar

Syed Refat Al Abrar bluetoothfx

View GitHub Profile
Open VS code in a specific directory
> code .
Open terminal VS Code
> Ctrl + `
Duplicate line:
> Alt + Shift + Up/Down Arrow
Move a Line Up/Down:
Eventbus:
https://alligator.io/vuejs/global-event-bus/
Materialize Css:
https://materializecss.com
@bluetoothfx
bluetoothfx / Go_Lang_Setup.txt
Last active October 7, 2019 19:40
Start a go project
For windows:
1. install go package from following
https://golang.org/dl/
2. From Git bash (may follow like):
mkdir -p $GOPATH/src/<project-root>/<user-name>/<project-name>
example:
mkdir -p $GOPATH/src/github.com/bluetoothfx/restapi
3. If it fails to create GO folder then do set Go path by below command
@bluetoothfx
bluetoothfx / Basic Postgresql command
Last active November 23, 2019 20:01
Some quick command for Postgresql
TRUNCATE TABLE table_name RESTART IDENTITY;
TRUNCATE TABLE "AspNetUsers" CASCADE;
@bluetoothfx
bluetoothfx / journalctl
Last active January 7, 2020 20:36
simple journalctl usage
#Example
https://blog.selectel.com/managing-logging-systemd/
# export
sudo journalctl -u kestrel-mysite.service -o cat > log2.txt
#purge journalctl
sudo journalctl --rotate --vacuum-time=1s
#show recent log
@bluetoothfx
bluetoothfx / redis.learn
Last active May 29, 2023 07:04
Start a Redis database using Docker
# To get & run redis on docker (6379 is default port)
> docker run -d -p 6379:6379 --name redis1 redis
# Run redis on docker & guaranteed backup (-create /home/redisDB directory 1st in your host machine)
> docker run -v /home/redisDB:/data -d -p 6379:6379 --name redis1 redis redis-server --appendonly yes
# to check if redis is functioning in docker (status checking)
> docker ps
# to view redis logs
> docker logs redis1
# start a new interactive session (-it) inside the running container
> docker exec -it redis1 sh
Login psql from terminal
> sudo -i -u postgres psql
List of DB
> \l
List available tables
> \dt
Describe a table
@bluetoothfx
bluetoothfx / docker-compose
Last active March 28, 2020 15:55
simple docker compose commands
#To check docker compose version
> docker-compose -v
#To create docker file
> touch docker-compose.yml
#Docker compose file validity
> docker-compose config
#Start docker compose
Need a linux hosted VM (ex. Ubuntu)
STEP 01. Add Following yml file (which is created by default - Git action template)
*******************************File Start*************************************
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
@bluetoothfx
bluetoothfx / tmux_basics
Last active March 26, 2020 09:14
basic tmux commands
tmux:
What is tmux?
Tmux is a terminal multiplexer an alternative to GNU Screen. In other words, it means that you can start a Tmux session and then open multiple windows inside that session. Each window occupies the entire screen and can be split into rectangular panes.
With Tmux you can easily switch between multiple programs in one terminal, detach them and reattach them to a different terminal.
Tmux sessions are persistent, which means that programs running in Tmux will continue to run even if you get disconnected.
All commands in Tmux start with a prefix, which by default is ctrl+b.