GithubHelp home page GithubHelp logo

davidnicholai / my-environment Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 49 KB

Personal configs, dotfiles, scripts

Batchfile 10.28% Shell 44.72% JavaScript 36.37% Dockerfile 6.73% Vim Script 1.90%

my-environment's Introduction

David's Environment Configurations

  • debian-install.sh - Setup my configurations in a Debian environment (for my rpi and Ubuntu machines).
  • raspbian-install-docker.sh - A script to install Docker in my rpi.
  • ubuntu-install-docker.sh - A script to install Docker in my Ubuntu images.

Tips

Any UNIX-related commands I will def forget in the future are listed below.

Bash

Miscellaneous

To delete all files/directories inside a directory

  • File: find . -type f -name 'FILE_NAME' -exec rm -r {} +
  • Directory: find . -type d -name 'DIRECTORY_NAME' -exec rm -r {} +

Scan directory and delete bin/obj directories find . \( -name 'bin' -o -name 'obj' \) -type d -exec rm -r {} +

To synchronize files rsync -av[n] SRC DEST Adding n (dry-run) will print a list of files to be transferred

To kill a process such as tmux pkill -f tmux

Fix WARNING: UNPROTECTED PRIVATE KEY FILE sudo chmod 600 ~/.ssh/id_rsa

To own the contents of a directory sudo chown -R david:david .

Restart a service: sudo systemctl [restart/stop/start] raspotify

Add SSH public key to remote server: ssh-copy-id -i /path/to/file [user@]192.168.1.123

To mount a gpt image built from ddrescue:

losetup --partscan --find --show disk.img
mount /dev/loop0p1 /mnt

# to free it up, unmount then
losetup -d /dev/loop0

Docker

Check out the Dockerfile in this repository if you need a reference.

Build image from a Dockerfile: docker build -t DESIRED_TAG_NAME .

Run your image: docker run [-p 80:80] [-d/--detach] TAG_OF_BUILT_DOCKER_IMAGE

Run command in image: docker exec -it TAG_OF_BUILT_DOCKER_IMAGE bash

List running containers: docker ps [-a|--all]

Delete a Docker container: docker rm TAG_OF_CONTAINER

Stop a container: docker stop CONTAINER

Remove unused images: docker image prune

List images: docker image ls

Delete images: docker image rm IMAGE_ID [IMAGE_IDS]

Maybe you want to start a new Django project but want to do everything in Docker:

docker run -it --volume /home/yourusername/dev/my-python-project:/app python:3.9.6 /bin/bash

Pyenv Virtualenv

To create a virtualenv

pyenv virtualenv 3.8.5 my-virtual-env-3.8.5

List all virtualenvs

pyenv virtualenvs

Activate virtualenv

pyenv activate my-virtual-env-3.8.5

To automatically load virtualenv in the Terminal, create a file .python-version in the root of the project, then the contents should be:

3.8.5

or

3.8.5/envs/<name_of_virtualenv>

Heroku

Deploy from local branch to Heroku git push heroku <branch_name>:main Connecting via bash heroku ps:exec /bin/bash Connect local repo to Heroku heroku git:remote -a <heroku_project>

GNOME

Alt+tab on active workspace only

`gsettings set org.gnome.shell.app-switcher current-workspace-only true``

my-environment's People

Contributors

davidnicholai avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.