Skip to content

Instantly share code, notes, and snippets.

@Ou42
Created January 27, 2023 19:30
Show Gist options
  • Save Ou42/c773e990dc760a9a24e12fc486b74705 to your computer and use it in GitHub Desktop.
Save Ou42/c773e990dc760a9a24e12fc486b74705 to your computer and use it in GitHub Desktop.
Dev Setup on Native Linux Install - 2023-01-26

Native Linux Setup - 2023-01-26

Git setup

  • set user.name
    • $ git config --global user.name "----"
  • set user.email
    • $ git config --global user.email "----"
  • set init.defaultbranch
    • $ git config --global init.defaultbranch main
$ git config --list
user.name=----
user.email=----
init.defaultbranch=main

Installed vscode extensions:

  • Markdown Preview Github Styling
  • Markdown Checkboxes

Git Credential Helper

per: https://www.softwaredeveloper.blog/git-credential-storage-libsecret

$ sudo apt-get install libsecret-1-0 libsecret-1-dev
... (libsecret-1-0 was already installed)
$ cd /usr/share/doc/git/contrib/credential/libsecret
$ sudo make
$ git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

Bash It

nvm, node & npm

$ nvm install --lts
...
Now using node v18.13.0 (npm v8.19.3)
Creating default alias: default -> lts/* (-> v18.13.0)

$ node --version
v18.13.0

$ npm --version
8.19.3

git clone

$ git clone https://github.com/Ou42/angular-15-node-project.git

$ cd angular-15-node-project/

$ git branch -a
* main
  remotes/origin/HEAD -> origin/main
  remotes/origin/angular-15
  remotes/origin/main

$ git checkout angular-15 
Branch 'angular-15' set up to track remote branch 'angular-15' from 'origin'.
Switched to a new branch 'angular-15'

npm install (2x)

$ du -d 1 -h
448K	./.git
40K	./app
920K	./angular-15-crud-example
1.5M	.

$ npm install

added 93 packages, and audited 94 packages in 4s
...

$ du -d 1 -h
448K	./.git
40K	./app
29M	./node_modules
920K	./angular-15-crud-example
31M	.
$ cd angular-15-crud-example/

$ du -d 1 -h
16K	./.vscode
128K	./src
920K	.

$ npm install
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1

added 889 packages, and audited 890 packages in 34s
...
1 high severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

$ du -d 1 -h
397M	./node_modules
16K	./.vscode
128K	./src
398M	.

$ npm audit
# npm audit report

ua-parser-js  <0.7.33
Severity: high
ReDoS Vulnerability in ua-parser-js version  - https://github.com/advisories/GHSA-fhg7-m89q-25r3
fix available via `npm audit fix`
node_modules/ua-parser-js

1 high severity vulnerability

To address all issues, run:
  npm audit fix

$ npm audit fix

changed 1 package, and audited 890 packages in 4s
...
found 0 vulnerabilities

$ cd ..

mysql via podman

$ podman pull mysql:8-debian
...

$ podman images
REPOSITORY               TAG         IMAGE ID      CREATED     SIZE
docker.io/library/mysql  8-debian    33ba092bab95  9 days ago  601 MB

$ podman run --name my-mysql -e MYSQL_ROOT_PASSWORD=<secret> -v $HOME/mysql-data:/var/lib/mysql -d mysql:8-debian
...

$ podman exec -it my-mysql mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.32 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

mysql> CREATE DATABASE testdb;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| testdb             |
+--------------------+
5 rows in set (0.00 sec)
$ podman ps
...

$ podman rm my-mysql

$ podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES

$ podman rm b43c07ed0063 
...

$ podman run --name my-mysql -e MYSQL_ROOT_PASSWORD=<secret> -v $HOME/mysql-data:/var/lib/mysql -d mysql:8-debian -p 3306:3306

@Ou42
Copy link
Author

Ou42 commented Jan 30, 2023

To RUN/TEST:

@oldfartdeveloper
Copy link

Are you saying that even though the podman arguments have assigned argument names they still have to be entered in a specific order? That seems like lazy API design on their part. Or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment