Skip to content

Instantly share code, notes, and snippets.

View josdem's full-sized avatar
🤖
Moving to Google Cloud

Jose Morales josdem

🤖
Moving to Google Cloud
View GitHub Profile
//Print a list of all databases on the server
show dbs
//Switch or create database
use {database}
//Print a list of all collections for current database
db.getCollectionNames()
//Find all documents in the collection and returns a cursor
@josdem
josdem / Mysql
Last active April 23, 2024 14:49
//Set mysql root password
mysqladmin -u root password NEWPASSWORD
//Creates a new database
create database {databaseName}
//Show MySQL version from Workbench
SHOW VARIABLES LIKE "%version%";
//Create user
#Open a File
Command + Shift + O
#Optimize imports in the current file
Control + Option + O
Control + Alt + O
#Duplicate a line
Command + D
@josdem
josdem / VSCode
Last active October 14, 2023 15:42
VisualStudioCode
# Duplicate a line
Shift + Option + ArrowDown
Alt + Shift + D (To configure)
# Move a line
Alt + Up
Alt + Down
Option + Up
Option + Down
@josdem
josdem / Linux
Last active June 28, 2023 01:02
# Ubuntu
//How to see Linux version
lsb_release -a
cat /etc/centos-release
//Add user
adduser tomcat
//Add user with home directory
@josdem
josdem / Git
Last active June 4, 2023 00:10
## Basic Commands
//Clone a project
git clone git@github.com:josdem/jmailer-spring-boot.git
//Get lastest changes from a project
git pull origin master
//Commit a change to a project
git commit -am "This is a comment about my changes to the project"
@josdem
josdem / NVM
Last active April 24, 2023 18:48
#List available node releases
nvm ls-remote
#Install specific node version
nvm install <node_version>
#Install LTS release
nvm install --lts
@josdem
josdem / Power Shell
Last active February 22, 2022 15:49
//Set proxy environment
setx HTTPS_PROXY http://proxy-url:8080
setx HTTP_PROXY http://proxy-url:8080
//Delete a directory
Remove-Item ${directory} -Recurse -Force
@josdem
josdem / Jenkins
Last active September 5, 2021 22:36
//Change listen port
vim /etc/default/jenkins
HTTP_PORT=8081
//Start Jenkins server
sudo systemctl start jenkins
//Setting NVM and nodeJS command
export NVM_DIR="$HOME/.nvm"
. ~/.nvm/nvm.sh
@josdem
josdem / sts.desktop
Last active January 5, 2020 13:09
Set sts icon in ubuntu
[Desktop Entry]
Type=Application
Name=sts
Comment=Spring Tool Suite
Icon=/home/josdem/STS/sts-3.7.3.RELEASE/icon.xpm
Exec=/home/josdem/STS/sts-3.7.3.RELEASE/STS
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=STS