Skip to content

Instantly share code, notes, and snippets.

@nirajgiriXD
Last active August 2, 2024 11:41
Show Gist options
  • Save nirajgiriXD/acab92c60d66fa34510338ca23981d24 to your computer and use it in GitHub Desktop.
Save nirajgiriXD/acab92c60d66fa34510338ca23981d24 to your computer and use it in GitHub Desktop.
Useful Commands

Useful Commands

Bash:

history
!historyId
whoami
brew update
brew update <package-name>
rm -rf .*
chsh -s /bin/zsh 
open -na Google\ Chrome --args --user-data-dir=/tmp/temporary-chrome-profile-dir --disable-web-security --allow-running-insecure-content

SSH:

ssh-keygen
ssh-copy-id
ssh <username>@<remote-host>
ssh-keygen -l -f ~/.ssh/id_ed25519.pub

Lando:

lando start
lando stop
lando info
lando enable-cron
lando rebuild -s appserver
lando xdebug debug
lando wp i18n make-pot . ./destination/path/file_name.pot --exclude=<dir>

Docker:

docker exec -it containerId bash
docker ps
docker info
docker images
docker image ls
docker stats
docker version
docker start containerId
docker stop containerId
docker restart containerId
docker pull image
docker push image
docker logs containerId
docker exec -it containerId executable
docker rename oldContainerName newContainerName 

Mariadb / MySQL:

mariadb -u username -p password;
show databases;
use databaseName;
create database databaseName;
drop database databaseName;
alter database databaseNameOld alter/modify name=databaseNameNew;
backup database databaseName to disk=“absolutefilepath”;
show tables;
use tableName;
explain tableName; 
create table tableName (id INT NOT NULL, var dataType(size), PRIMARY KEY(id));
insert into tableName (columnName) VALUES (value);
select columnName from tableName;
update  tableName set columnName=value where columnName=value;
delete from tableName where columnName where columnName=value;
drop table tableName;
alter table tableName add coumnName dataType(size);
alter table tableName drop column coumnName;
alter table tableName rename column coumnNameOld to columnNameNew;
alter table tableName alter/modify column coumnName dataType(size);

TypeScript:

tsc
tsc --init
tsc <filename.ts>

Flutter:

flutter create <project-name>
flutter doctor
flutter upgrade
flutter pub get
flutter run
flutter run --<mode>
flutter build apk --build-name=<build-name> --build-number=<build-number>
flutter build apk --release
flutter build apk --debug

Python:

pip freeze > requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment