<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.johnfreier.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jfreier</id>
		<title>John Freier - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.johnfreier.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jfreier"/>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Special:Contributions/Jfreier"/>
		<updated>2026-05-20T09:58:15Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1187</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1187"/>
				<updated>2026-05-14T20:27:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Podman ==&lt;br /&gt;
&lt;br /&gt;
'''Start Podman'''&lt;br /&gt;
  podman machine start&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
'''List Images'''&lt;br /&gt;
  podman images&lt;br /&gt;
&lt;br /&gt;
'''Pull an image'''&lt;br /&gt;
  podman pull docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
'''Run an image'''&lt;br /&gt;
  podman run -dt -p 8080:80/tcp docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it --entrypoint=&amp;quot;/bin/sh&amp;quot; docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it -v /home/user/project:/app --entrypoint=&amp;quot;/bin/bash&amp;quot; python:3.9.13-buster&lt;br /&gt;
&lt;br /&gt;
* The -d will run the container in detach mode, so you wont see any console.&lt;br /&gt;
* The -t command connects the container to your terminal so it will not exit after it runs.&lt;br /&gt;
&lt;br /&gt;
The following command with -rm will clean up the container and remove any persists data.&lt;br /&gt;
  podman run -rm docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
To commit a container to the list of podman images.&lt;br /&gt;
  podman commit {id}&lt;br /&gt;
&lt;br /&gt;
'''Continue a container'''&lt;br /&gt;
This will start back up an exited container, it will continue where you left off.&lt;br /&gt;
  podman start {id}&lt;br /&gt;
To start with shell.&lt;br /&gt;
  podman start -ai {id}&lt;br /&gt;
&lt;br /&gt;
'''Get in to a running container'''&lt;br /&gt;
   podman exec -it {id} /bin/sh&lt;br /&gt;
&lt;br /&gt;
'''List running images'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Image'''&lt;br /&gt;
  podman rmi {image_sha}&lt;br /&gt;
&lt;br /&gt;
'''Load an Image'''&lt;br /&gt;
  Worked&lt;br /&gt;
  cat cs-oci.tar | podman load&lt;br /&gt;
  &lt;br /&gt;
  Did not work.&lt;br /&gt;
  podman load oci-archive:cs-oci.tar:latest&lt;br /&gt;
&lt;br /&gt;
'''Update the tag for an image'''&lt;br /&gt;
  podman tag e7b8dd57dec6 cs:latest&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
'''List all containers'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Container'''&lt;br /&gt;
  podman rm ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Remove all stopped Containers'''&lt;br /&gt;
  podman container prune&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
&lt;br /&gt;
'''Create a pod'''&lt;br /&gt;
  podman pod create --name mypod&lt;br /&gt;
&lt;br /&gt;
'''List pods'''&lt;br /&gt;
  podman pod list&lt;br /&gt;
&lt;br /&gt;
'''Start pod'''&lt;br /&gt;
  podman pod start {podname}&lt;br /&gt;
&lt;br /&gt;
'''Stop pod'''&lt;br /&gt;
  podman pod stop {podname}&lt;br /&gt;
&lt;br /&gt;
'''List all processes with pods'''&lt;br /&gt;
  podman ps -a --pod&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
Volume in Podman can be a virtual volume that is mounted through Podman.  This virtual volume can be exported or imported as well.&lt;br /&gt;
&lt;br /&gt;
You can also setup to point to a local host directory but because Podman is rootless Podman will need access to the directory, by either permissions on the directory or the user that runs the container from Podman.&lt;br /&gt;
&lt;br /&gt;
'''Create Virtual Volume'''&lt;br /&gt;
  podman volume create myvolume&lt;br /&gt;
&lt;br /&gt;
'''Export Virtual Volume'''&lt;br /&gt;
  podman volume export myvolume --output myvolume.tar&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
To login to a repository.&lt;br /&gt;
The below example is for harbor but could be used for others.&lt;br /&gt;
  podman login --username JDOE --password {cli_secret}  https://registry.harbor-url.com/&lt;br /&gt;
&lt;br /&gt;
== Build ==&lt;br /&gt;
&lt;br /&gt;
To build and avoid any cached layers use the following.&lt;br /&gt;
  podman build --no-cache -t $container_name:$container_tag .&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
'''View Logs'''&lt;br /&gt;
  podman logs ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Stop the latest container'''&lt;br /&gt;
&lt;br /&gt;
  podman stop ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
== Kube ==&lt;br /&gt;
&lt;br /&gt;
'''Generate kubernetes yaml'''&lt;br /&gt;
  podman generate kube -f infra.yaml mypod&lt;br /&gt;
&lt;br /&gt;
'''Load kubernetes yaml'''&lt;br /&gt;
  podman play kube infra.yaml&lt;br /&gt;
&lt;br /&gt;
'''Kubernetes File'''&lt;br /&gt;
# Kubernetes setup for CS.&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: ConfigMap&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: cs-config&lt;br /&gt;
  data:&lt;br /&gt;
    CS_DATABASE_MONGODB_EMBEDED_ENABLED: &amp;quot;false&amp;quot;&lt;br /&gt;
    SPRING_DATA_MONGODB_HOST: &amp;quot;localhost&amp;quot;&lt;br /&gt;
  ---&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: Pod&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: mypod&lt;br /&gt;
    labels:&lt;br /&gt;
      app: mypod&lt;br /&gt;
  spec:&lt;br /&gt;
    containers:&lt;br /&gt;
      - name: database&lt;br /&gt;
        image: docker.io/library/mongo:4.4.13&lt;br /&gt;
        securityContext:&lt;br /&gt;
          runAsUser: 0&lt;br /&gt;
        volumeMounts:&lt;br /&gt;
          - name: mongodb-data-volume&lt;br /&gt;
            mountPath: /data/db&lt;br /&gt;
      - name: application&lt;br /&gt;
        image: cs:latest&lt;br /&gt;
        ports:&lt;br /&gt;
          - containerPort: 8080&lt;br /&gt;
            hostPort: 8080&lt;br /&gt;
        envFrom:&lt;br /&gt;
          - configMapRef:&lt;br /&gt;
             name: cs-config&lt;br /&gt;
    volumes:&lt;br /&gt;
      - name: mongodb-data-volume&lt;br /&gt;
        persistentVolumeClaim:&lt;br /&gt;
          claimName: mongodb-data-storage&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example run MongoDB'''&lt;br /&gt;
  podman run \ &lt;br /&gt;
    --detach \ &lt;br /&gt;
    --publish 27017:27017 \&lt;br /&gt;
    --userns=keep-id \ &lt;br /&gt;
    --volume ./mongo-data:/data/db \ &lt;br /&gt;
    --name some-mongo \ &lt;br /&gt;
    mongo:4.4.13 &lt;br /&gt;
  &lt;br /&gt;
  # --detach, -d - Detached mode: run the container in the background and print the new container ID. The default is false&lt;br /&gt;
  # --publish, -p - Publish a container’s port, or range of ports, to the host.&lt;br /&gt;
  # --userns - Because podman runs rootless we need to assign a user that can access the local volumn.  This sets the podman user to the same user who ran the podman command.&lt;br /&gt;
  # --volume, -v - Create a bind mount.&lt;br /&gt;
  # --name - Assign a name to the container.&lt;br /&gt;
&lt;br /&gt;
'''Example running with pods'''&lt;br /&gt;
This is a test to see how apps can talk between each other in a podman network within a pod.&lt;br /&gt;
&lt;br /&gt;
Create the pod&lt;br /&gt;
  podman pod create --userns=keep-id --publish 8080:8080 --name mypod&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --volume ./mongo-data:/data/db --pod mypod --name some-mongo mongo:4.4.13&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --pod mypod --name myapp -e SPRING_DATA_MONGODB_HOST=&amp;quot;localhost&amp;quot; -e CS_DATABASE_MONGODB_EMBEDED_ENABLED=&amp;quot;false&amp;quot; e7b8dd57dec6&lt;br /&gt;
&lt;br /&gt;
  Not used - only for debug&lt;br /&gt;
  podman run -it --pod mypod --name myapp --volume ./config:/config --entrypoint &amp;quot;/bin/sh&amp;quot; e7b8dd57dec6&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1186</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1186"/>
				<updated>2026-05-11T14:28:31Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Database Connection ==&lt;br /&gt;
This is a way to test the database connection.&lt;br /&gt;
  ./pg_isready -h localhost -p 5432&lt;br /&gt;
&lt;br /&gt;
== Application Structure ==&lt;br /&gt;
Log location&lt;br /&gt;
 ./data/log/&lt;br /&gt;
&lt;br /&gt;
== OSX ==&lt;br /&gt;
The Postgres app live here on OSX&lt;br /&gt;
  /Library/PostgreSQL/11&lt;br /&gt;
&lt;br /&gt;
Start&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data start&lt;br /&gt;
&lt;br /&gt;
Stop&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
FYI, haven't tried but look like a nicer app to control Postgres is https://postgresapp.com.&lt;br /&gt;
&lt;br /&gt;
If you are not using the system registered database you can all simply use the following commands.&lt;br /&gt;
&lt;br /&gt;
  pg_ctl -D ./data start&lt;br /&gt;
  pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
== Initialize a database directory ==&lt;br /&gt;
To initialize a database directory use the following command.&lt;br /&gt;
&lt;br /&gt;
  initdb -D &amp;lt;data_directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Environment Path ==&lt;br /&gt;
To add PostgreSQL in to your environment path.&lt;br /&gt;
&lt;br /&gt;
  export POSTGRESQL_HOME=/Library/PostgreSQL/11&lt;br /&gt;
  PATH=$PATH:$POSTGRESQL_HOME/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
You can start Postgres in Debian using&lt;br /&gt;
  /etc/init.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
Create a database and user&lt;br /&gt;
  sudo su - postgres&lt;br /&gt;
  createdb testdb&lt;br /&gt;
  createuser testdb&lt;br /&gt;
&lt;br /&gt;
To create a password for the user either use&lt;br /&gt;
  createuser testdb --pwprompt&lt;br /&gt;
or&lt;br /&gt;
  psql&lt;br /&gt;
  ALTER USER 'testdb' WITH PASSWORD 'testdb';&lt;br /&gt;
&lt;br /&gt;
To have the new user be a superuser add the following.&lt;br /&gt;
  createuser --superuser testdb --pwprompt&lt;br /&gt;
&lt;br /&gt;
== Run file and commands from CLI ==&lt;br /&gt;
PSQL will ask for your password every time unless you set it as an environment variable.&lt;br /&gt;
  export PGPASSWORD=Password123&lt;br /&gt;
&lt;br /&gt;
To run a command.&lt;br /&gt;
  psql -U user_name -d database_name -c &amp;quot;SELECT * FROM tblExample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To run a file.&lt;br /&gt;
  psql -U user_name -d database_name -f ./file.sql&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
Error Connecting to database FATAL : no pg_hba.conf entry for host&lt;br /&gt;
I had to add the host ip address into the pg_hba.conf file.&lt;br /&gt;
&lt;br /&gt;
location of file: ./data/pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Added the following line and then restarted Postgres.&lt;br /&gt;
  host    all             all             10.225.41.95/24        md5&lt;br /&gt;
&lt;br /&gt;
== Describe a table ==&lt;br /&gt;
You can query the 'information_schema.columns' table to find internal table information.&lt;br /&gt;
&lt;br /&gt;
This is a sample command to find information about a table.&lt;br /&gt;
  SELECT table_name, column_name, data_type&lt;br /&gt;
  FROM information_schema.columns&lt;br /&gt;
  WHERE table_name='TABLE_A';&lt;br /&gt;
&lt;br /&gt;
== Top 10 rows ==&lt;br /&gt;
This is to get the top 10 rows.&lt;br /&gt;
  select *&lt;br /&gt;
  from table_a&lt;br /&gt;
  fetch first 10 rows only;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== PSQL VIM ==&lt;br /&gt;
Tips for editing script and running them in th PSQL command.&lt;br /&gt;
&lt;br /&gt;
1. Edit a script in vim.  Once logged in use the following command.&lt;br /&gt;
  \e&lt;br /&gt;
&lt;br /&gt;
2. Multiple windows.&lt;br /&gt;
In 1 window connect using the psql tool and run scripts using the following command.&lt;br /&gt;
  \o ./sql.out \i ./test.sql&lt;br /&gt;
&lt;br /&gt;
In 2 window using VIM, edit the test.sql file and open a new tab of sql.out.&lt;br /&gt;
Then refresh the buffer using &lt;br /&gt;
  :e&lt;br /&gt;
&lt;br /&gt;
== PSQL Sequence ==&lt;br /&gt;
To update the sequence to a new value.&lt;br /&gt;
  SELECT setval('sequence_name', 100);&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Java_maven&amp;diff=1185</id>
		<title>Java maven</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Java_maven&amp;diff=1185"/>
				<updated>2026-05-06T19:18:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using Maven to help compile Java projects.&lt;br /&gt;
&lt;br /&gt;
== Run Tests ==&lt;br /&gt;
To run a single test.&lt;br /&gt;
  mvn test -Dtest=ClassName#methodName&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Run Test with full stackTrace messages ==&lt;br /&gt;
To show the full error message when something goes wrong in a test.&lt;br /&gt;
  mvn test -Dtest=ClassName#methodName -DtrimStackTrace=false&lt;br /&gt;
&lt;br /&gt;
== Check dependencies ==&lt;br /&gt;
To check dependencies in the pom and versions.&lt;br /&gt;
&lt;br /&gt;
  mvn dependency:list | grep log4j&lt;br /&gt;
&lt;br /&gt;
  mvn dependency:tree | grep &amp;quot;bcprov-jdk18on&amp;quot; -C 10&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1184</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1184"/>
				<updated>2026-04-28T16:34:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Rebase ==&lt;br /&gt;
When you are on a branch, you get &lt;br /&gt;
  git rebase master&lt;br /&gt;
&lt;br /&gt;
You will get conflicts with the remote origin if you try and push. Here are some ways to solve this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will force the remote origin to stay up to date with your branch. But be aware, if there are more people working on the feature branch then just you, you may overwrite code.&lt;br /&gt;
  git push --force origin feature_branch&lt;br /&gt;
&lt;br /&gt;
With force with lease, git will warn you if anyone else has committed any code, this helps to prevent overwriting someones code.&lt;br /&gt;
  git push --force-with-lease&lt;br /&gt;
&lt;br /&gt;
Another good option after rebase with master is to just delete the branch on the remote origin, and then recreate it.&lt;br /&gt;
  git checkout myFeature&lt;br /&gt;
  git rebase master&lt;br /&gt;
  git push origin --delete myFeature&lt;br /&gt;
  git push origin myFeature&lt;br /&gt;
&lt;br /&gt;
== Squash feature branch ==&lt;br /&gt;
This squashes all the commits in to one.&lt;br /&gt;
  git merge --squash feature &lt;br /&gt;
&lt;br /&gt;
and then you need to commit the new squashed changes.&lt;br /&gt;
  get commit -m &amp;quot;squashed changes merged in.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Squash Commits ==&lt;br /&gt;
This squashes the last 3 commits.&lt;br /&gt;
  git reset --soft HEAD~3&lt;br /&gt;
  git commit -m 'new commit message'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the logs ==&lt;br /&gt;
A another way to view the logs.&lt;br /&gt;
  git log --oneline --decorate --graph --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add all untracked changes. ==&lt;br /&gt;
Here is a couple of commands to help with backing things up.&lt;br /&gt;
This will add all untracked changes for a file type.&lt;br /&gt;
  git ls-files --other | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
This will add all tracked changes for a file type.&lt;br /&gt;
  git ls-files | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sign with GPG ==&lt;br /&gt;
List your keys&lt;br /&gt;
  gpg --list-secret-keys --keyid-format=long&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update git to use a specific key.&lt;br /&gt;
  git config --global user.signingkey 3AA5C34371567BD2&lt;br /&gt;
&lt;br /&gt;
Sign all commits by default.&lt;br /&gt;
  git config --global commit.gpgsign true&lt;br /&gt;
&lt;br /&gt;
== Stash ==&lt;br /&gt;
Add a name to your stash.&lt;br /&gt;
  git stash push -m &amp;quot;your_custom_name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
List your stash.&lt;br /&gt;
  git stash list&lt;br /&gt;
&lt;br /&gt;
Apply your stash.&lt;br /&gt;
  git stash apply stash^{/your_custom_name}&lt;br /&gt;
&lt;br /&gt;
Apply and remove your stash&lt;br /&gt;
  git stash pop stash^{/your_custom_name}&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1183</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1183"/>
				<updated>2026-04-28T16:33:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Rebase ==&lt;br /&gt;
When you are on a branch, you get &lt;br /&gt;
  git rebase master&lt;br /&gt;
&lt;br /&gt;
You will get conflicts with the remote origin if you try and push. Here are some ways to solve this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will force the remote origin to stay up to date with your branch. But be aware, if there are more people working on the feature branch then just you, you may overwrite code.&lt;br /&gt;
  git push --force origin feature_branch&lt;br /&gt;
&lt;br /&gt;
With force with lease, git will warn you if anyone else has committed any code, this helps to prevent overwriting someones code.&lt;br /&gt;
  git push --force-with-lease&lt;br /&gt;
&lt;br /&gt;
Another good option after rebase with master is to just delete the branch on the remote origin, and then recreate it.&lt;br /&gt;
  git checkout myFeature&lt;br /&gt;
  git rebase master&lt;br /&gt;
  git push origin --delete myFeature&lt;br /&gt;
  git push origin myFeature&lt;br /&gt;
&lt;br /&gt;
== Squash feature branch ==&lt;br /&gt;
This squashes all the commits in to one.&lt;br /&gt;
  git merge --squash feature &lt;br /&gt;
&lt;br /&gt;
and then you need to commit the new squashed changes.&lt;br /&gt;
  get commit -m &amp;quot;squashed changes merged in.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Squash Commits ==&lt;br /&gt;
This squashes the last 3 commits.&lt;br /&gt;
  git reset --soft HEAD~3&lt;br /&gt;
  git commit -m 'new commit message'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the logs ==&lt;br /&gt;
A another way to view the logs.&lt;br /&gt;
  git log --oneline --decorate --graph --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add all untracked changes. ==&lt;br /&gt;
Here is a couple of commands to help with backing things up.&lt;br /&gt;
This will add all untracked changes for a file type.&lt;br /&gt;
  git ls-files --other | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
This will add all tracked changes for a file type.&lt;br /&gt;
  git ls-files | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Sign with GPG&lt;br /&gt;
List your keys&lt;br /&gt;
  gpg --list-secret-keys --keyid-format=long&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update git to use a specific key.&lt;br /&gt;
  git config --global user.signingkey 3AA5C34371567BD2&lt;br /&gt;
&lt;br /&gt;
Sign all commits by default.&lt;br /&gt;
  git config --global commit.gpgsign true&lt;br /&gt;
&lt;br /&gt;
==Stash&lt;br /&gt;
Add a name to your stash.&lt;br /&gt;
  git stash push -m &amp;quot;your_custom_name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
List your stash.&lt;br /&gt;
  git stash list&lt;br /&gt;
&lt;br /&gt;
Apply your stash.&lt;br /&gt;
  git stash apply stash^{/your_custom_name}&lt;br /&gt;
&lt;br /&gt;
Apply and remove your stash&lt;br /&gt;
  git stash pop stash^{/your_custom_name}&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1182</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1182"/>
				<updated>2026-04-28T16:33:35Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Rebase ==&lt;br /&gt;
When you are on a branch, you get &lt;br /&gt;
  git rebase master&lt;br /&gt;
&lt;br /&gt;
You will get conflicts with the remote origin if you try and push. Here are some ways to solve this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will force the remote origin to stay up to date with your branch. But be aware, if there are more people working on the feature branch then just you, you may overwrite code.&lt;br /&gt;
  git push --force origin feature_branch&lt;br /&gt;
&lt;br /&gt;
With force with lease, git will warn you if anyone else has committed any code, this helps to prevent overwriting someones code.&lt;br /&gt;
  git push --force-with-lease&lt;br /&gt;
&lt;br /&gt;
Another good option after rebase with master is to just delete the branch on the remote origin, and then recreate it.&lt;br /&gt;
  git checkout myFeature&lt;br /&gt;
  git rebase master&lt;br /&gt;
  git push origin --delete myFeature&lt;br /&gt;
  git push origin myFeature&lt;br /&gt;
&lt;br /&gt;
== Squash feature branch ==&lt;br /&gt;
This squashes all the commits in to one.&lt;br /&gt;
  git merge --squash feature &lt;br /&gt;
&lt;br /&gt;
and then you need to commit the new squashed changes.&lt;br /&gt;
  get commit -m &amp;quot;squashed changes merged in.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Squash Commits ==&lt;br /&gt;
This squashes the last 3 commits.&lt;br /&gt;
  git reset --soft HEAD~3&lt;br /&gt;
  git commit -m 'new commit message'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the logs ==&lt;br /&gt;
A another way to view the logs.&lt;br /&gt;
  git log --oneline --decorate --graph --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add all untracked changes. ==&lt;br /&gt;
Here is a couple of commands to help with backing things up.&lt;br /&gt;
This will add all untracked changes for a file type.&lt;br /&gt;
  git ls-files --other | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
This will add all tracked changes for a file type.&lt;br /&gt;
  git ls-files | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sign with GPG&lt;br /&gt;
List your keys&lt;br /&gt;
  gpg --list-secret-keys --keyid-format=long&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update git to use a specific key.&lt;br /&gt;
  git config --global user.signingkey 3AA5C34371567BD2&lt;br /&gt;
&lt;br /&gt;
Sign all commits by default.&lt;br /&gt;
  git config --global commit.gpgsign true&lt;br /&gt;
&lt;br /&gt;
== Stash&lt;br /&gt;
Add a name to your stash.&lt;br /&gt;
  git stash push -m &amp;quot;your_custom_name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
List your stash.&lt;br /&gt;
  git stash list&lt;br /&gt;
&lt;br /&gt;
Apply your stash.&lt;br /&gt;
  git stash apply stash^{/your_custom_name}&lt;br /&gt;
&lt;br /&gt;
Apply and remove your stash&lt;br /&gt;
  git stash pop stash^{/your_custom_name}&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1181</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1181"/>
				<updated>2026-03-02T17:52:23Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Podman ==&lt;br /&gt;
&lt;br /&gt;
'''Start Podman'''&lt;br /&gt;
  podman machine start&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
'''List Images'''&lt;br /&gt;
  podman images&lt;br /&gt;
&lt;br /&gt;
'''Pull an image'''&lt;br /&gt;
  podman pull docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
'''Run an image'''&lt;br /&gt;
  podman run -dt -p 8080:80/tcp docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it --entrypoint=&amp;quot;/bin/sh&amp;quot; docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it -v /home/user/project:/app --entrypoint=&amp;quot;/bin/bash&amp;quot; python:3.9.13-buster&lt;br /&gt;
&lt;br /&gt;
* The -d will run the container in detach mode, so you wont see any console.&lt;br /&gt;
* The -t command connects the container to your terminal so it will not exit after it runs.&lt;br /&gt;
&lt;br /&gt;
The following command with -rm will clean up the container and remove any persists data.&lt;br /&gt;
  podman run -rm docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
To commit a container to the list of podman images.&lt;br /&gt;
  podman commit {id}&lt;br /&gt;
&lt;br /&gt;
'''Continue a container'''&lt;br /&gt;
This will start back up an exited container, it will continue where you left off.&lt;br /&gt;
  podman start {id}&lt;br /&gt;
&lt;br /&gt;
'''Get in to a running container'''&lt;br /&gt;
   podman exec -it {id} /bin/sh&lt;br /&gt;
&lt;br /&gt;
'''List running images'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Image'''&lt;br /&gt;
  podman rmi {image_sha}&lt;br /&gt;
&lt;br /&gt;
'''Load an Image'''&lt;br /&gt;
  Worked&lt;br /&gt;
  cat cs-oci.tar | podman load&lt;br /&gt;
  &lt;br /&gt;
  Did not work.&lt;br /&gt;
  podman load oci-archive:cs-oci.tar:latest&lt;br /&gt;
&lt;br /&gt;
'''Update the tag for an image'''&lt;br /&gt;
  podman tag e7b8dd57dec6 cs:latest&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
'''List all containers'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Container'''&lt;br /&gt;
  podman rm ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Remove all stopped Containers'''&lt;br /&gt;
  podman container prune&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
&lt;br /&gt;
'''Create a pod'''&lt;br /&gt;
  podman pod create --name mypod&lt;br /&gt;
&lt;br /&gt;
'''List pods'''&lt;br /&gt;
  podman pod list&lt;br /&gt;
&lt;br /&gt;
'''Start pod'''&lt;br /&gt;
  podman pod start {podname}&lt;br /&gt;
&lt;br /&gt;
'''Stop pod'''&lt;br /&gt;
  podman pod stop {podname}&lt;br /&gt;
&lt;br /&gt;
'''List all processes with pods'''&lt;br /&gt;
  podman ps -a --pod&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
Volume in Podman can be a virtual volume that is mounted through Podman.  This virtual volume can be exported or imported as well.&lt;br /&gt;
&lt;br /&gt;
You can also setup to point to a local host directory but because Podman is rootless Podman will need access to the directory, by either permissions on the directory or the user that runs the container from Podman.&lt;br /&gt;
&lt;br /&gt;
'''Create Virtual Volume'''&lt;br /&gt;
  podman volume create myvolume&lt;br /&gt;
&lt;br /&gt;
'''Export Virtual Volume'''&lt;br /&gt;
  podman volume export myvolume --output myvolume.tar&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
To login to a repository.&lt;br /&gt;
The below example is for harbor but could be used for others.&lt;br /&gt;
  podman login --username JDOE --password {cli_secret}  https://registry.harbor-url.com/&lt;br /&gt;
&lt;br /&gt;
== Build ==&lt;br /&gt;
&lt;br /&gt;
To build and avoid any cached layers use the following.&lt;br /&gt;
  podman build --no-cache -t $container_name:$container_tag .&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
'''View Logs'''&lt;br /&gt;
  podman logs ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Stop the latest container'''&lt;br /&gt;
&lt;br /&gt;
  podman stop ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
== Kube ==&lt;br /&gt;
&lt;br /&gt;
'''Generate kubernetes yaml'''&lt;br /&gt;
  podman generate kube -f infra.yaml mypod&lt;br /&gt;
&lt;br /&gt;
'''Load kubernetes yaml'''&lt;br /&gt;
  podman play kube infra.yaml&lt;br /&gt;
&lt;br /&gt;
'''Kubernetes File'''&lt;br /&gt;
# Kubernetes setup for CS.&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: ConfigMap&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: cs-config&lt;br /&gt;
  data:&lt;br /&gt;
    CS_DATABASE_MONGODB_EMBEDED_ENABLED: &amp;quot;false&amp;quot;&lt;br /&gt;
    SPRING_DATA_MONGODB_HOST: &amp;quot;localhost&amp;quot;&lt;br /&gt;
  ---&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: Pod&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: mypod&lt;br /&gt;
    labels:&lt;br /&gt;
      app: mypod&lt;br /&gt;
  spec:&lt;br /&gt;
    containers:&lt;br /&gt;
      - name: database&lt;br /&gt;
        image: docker.io/library/mongo:4.4.13&lt;br /&gt;
        securityContext:&lt;br /&gt;
          runAsUser: 0&lt;br /&gt;
        volumeMounts:&lt;br /&gt;
          - name: mongodb-data-volume&lt;br /&gt;
            mountPath: /data/db&lt;br /&gt;
      - name: application&lt;br /&gt;
        image: cs:latest&lt;br /&gt;
        ports:&lt;br /&gt;
          - containerPort: 8080&lt;br /&gt;
            hostPort: 8080&lt;br /&gt;
        envFrom:&lt;br /&gt;
          - configMapRef:&lt;br /&gt;
             name: cs-config&lt;br /&gt;
    volumes:&lt;br /&gt;
      - name: mongodb-data-volume&lt;br /&gt;
        persistentVolumeClaim:&lt;br /&gt;
          claimName: mongodb-data-storage&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example run MongoDB'''&lt;br /&gt;
  podman run \ &lt;br /&gt;
    --detach \ &lt;br /&gt;
    --publish 27017:27017 \&lt;br /&gt;
    --userns=keep-id \ &lt;br /&gt;
    --volume ./mongo-data:/data/db \ &lt;br /&gt;
    --name some-mongo \ &lt;br /&gt;
    mongo:4.4.13 &lt;br /&gt;
  &lt;br /&gt;
  # --detach, -d - Detached mode: run the container in the background and print the new container ID. The default is false&lt;br /&gt;
  # --publish, -p - Publish a container’s port, or range of ports, to the host.&lt;br /&gt;
  # --userns - Because podman runs rootless we need to assign a user that can access the local volumn.  This sets the podman user to the same user who ran the podman command.&lt;br /&gt;
  # --volume, -v - Create a bind mount.&lt;br /&gt;
  # --name - Assign a name to the container.&lt;br /&gt;
&lt;br /&gt;
'''Example running with pods'''&lt;br /&gt;
This is a test to see how apps can talk between each other in a podman network within a pod.&lt;br /&gt;
&lt;br /&gt;
Create the pod&lt;br /&gt;
  podman pod create --userns=keep-id --publish 8080:8080 --name mypod&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --volume ./mongo-data:/data/db --pod mypod --name some-mongo mongo:4.4.13&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --pod mypod --name myapp -e SPRING_DATA_MONGODB_HOST=&amp;quot;localhost&amp;quot; -e CS_DATABASE_MONGODB_EMBEDED_ENABLED=&amp;quot;false&amp;quot; e7b8dd57dec6&lt;br /&gt;
&lt;br /&gt;
  Not used - only for debug&lt;br /&gt;
  podman run -it --pod mypod --name myapp --volume ./config:/config --entrypoint &amp;quot;/bin/sh&amp;quot; e7b8dd57dec6&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1180</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1180"/>
				<updated>2026-02-19T16:29:00Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: /* Containers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Podman ==&lt;br /&gt;
&lt;br /&gt;
'''Start Podman'''&lt;br /&gt;
  podman machine start&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
'''List Images'''&lt;br /&gt;
  podman images&lt;br /&gt;
&lt;br /&gt;
'''Pull an image'''&lt;br /&gt;
  podman pull docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
'''Run an image'''&lt;br /&gt;
  podman run -dt -p 8080:80/tcp docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it --entrypoint=&amp;quot;/bin/sh&amp;quot; docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it -v /home/user/project:/app --entrypoint=&amp;quot;/bin/bash&amp;quot; python:3.9.13-buster&lt;br /&gt;
&lt;br /&gt;
* The -d will run the container in detach mode, so you wont see any console.&lt;br /&gt;
* The -t command connects the container to your terminal so it will not exit after it runs.&lt;br /&gt;
&lt;br /&gt;
The following command with -rm will clean up the container and remove any persists data.&lt;br /&gt;
  podman run -rm docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
To commit a container to the list of podman images.&lt;br /&gt;
  podman commit {id}&lt;br /&gt;
&lt;br /&gt;
'''Continue a container'''&lt;br /&gt;
This will start back up an exited container, it will continue where you left off.&lt;br /&gt;
  podman start {id}&lt;br /&gt;
&lt;br /&gt;
'''Get in to a running container'''&lt;br /&gt;
   podman exec -it {id} /bin/sh&lt;br /&gt;
&lt;br /&gt;
'''List running images'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Image'''&lt;br /&gt;
  podman rmi {image_sha}&lt;br /&gt;
&lt;br /&gt;
'''Load an Image'''&lt;br /&gt;
  Worked&lt;br /&gt;
  cat cs-oci.tar | podman load&lt;br /&gt;
  &lt;br /&gt;
  Did not work.&lt;br /&gt;
  podman load oci-archive:cs-oci.tar:latest&lt;br /&gt;
&lt;br /&gt;
'''Update the tag for an image'''&lt;br /&gt;
  podman tag e7b8dd57dec6 cs:latest&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
'''List all containers'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Container'''&lt;br /&gt;
  podman rm ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Remove all stopped Containers'''&lt;br /&gt;
podman container prune&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
&lt;br /&gt;
'''Create a pod'''&lt;br /&gt;
  podman pod create --name mypod&lt;br /&gt;
&lt;br /&gt;
'''List pods'''&lt;br /&gt;
  podman pod list&lt;br /&gt;
&lt;br /&gt;
'''Start pod'''&lt;br /&gt;
  podman pod start {podname}&lt;br /&gt;
&lt;br /&gt;
'''Stop pod'''&lt;br /&gt;
  podman pod stop {podname}&lt;br /&gt;
&lt;br /&gt;
'''List all processes with pods'''&lt;br /&gt;
  podman ps -a --pod&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
Volume in Podman can be a virtual volume that is mounted through Podman.  This virtual volume can be exported or imported as well.&lt;br /&gt;
&lt;br /&gt;
You can also setup to point to a local host directory but because Podman is rootless Podman will need access to the directory, by either permissions on the directory or the user that runs the container from Podman.&lt;br /&gt;
&lt;br /&gt;
'''Create Virtual Volume'''&lt;br /&gt;
  podman volume create myvolume&lt;br /&gt;
&lt;br /&gt;
'''Export Virtual Volume'''&lt;br /&gt;
  podman volume export myvolume --output myvolume.tar&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
To login to a repository.&lt;br /&gt;
The below example is for harbor but could be used for others.&lt;br /&gt;
  podman login --username JDOE --password {cli_secret}  https://registry.harbor-url.com/&lt;br /&gt;
&lt;br /&gt;
== Build ==&lt;br /&gt;
&lt;br /&gt;
To build and avoid any cached layers use the following.&lt;br /&gt;
  podman build --no-cache -t $container_name:$container_tag .&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
'''View Logs'''&lt;br /&gt;
  podman logs ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Stop the latest container'''&lt;br /&gt;
&lt;br /&gt;
  podman stop ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
== Kube ==&lt;br /&gt;
&lt;br /&gt;
'''Generate kubernetes yaml'''&lt;br /&gt;
  podman generate kube -f infra.yaml mypod&lt;br /&gt;
&lt;br /&gt;
'''Load kubernetes yaml'''&lt;br /&gt;
  podman play kube infra.yaml&lt;br /&gt;
&lt;br /&gt;
'''Kubernetes File'''&lt;br /&gt;
# Kubernetes setup for CS.&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: ConfigMap&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: cs-config&lt;br /&gt;
  data:&lt;br /&gt;
    CS_DATABASE_MONGODB_EMBEDED_ENABLED: &amp;quot;false&amp;quot;&lt;br /&gt;
    SPRING_DATA_MONGODB_HOST: &amp;quot;localhost&amp;quot;&lt;br /&gt;
  ---&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: Pod&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: mypod&lt;br /&gt;
    labels:&lt;br /&gt;
      app: mypod&lt;br /&gt;
  spec:&lt;br /&gt;
    containers:&lt;br /&gt;
      - name: database&lt;br /&gt;
        image: docker.io/library/mongo:4.4.13&lt;br /&gt;
        securityContext:&lt;br /&gt;
          runAsUser: 0&lt;br /&gt;
        volumeMounts:&lt;br /&gt;
          - name: mongodb-data-volume&lt;br /&gt;
            mountPath: /data/db&lt;br /&gt;
      - name: application&lt;br /&gt;
        image: cs:latest&lt;br /&gt;
        ports:&lt;br /&gt;
          - containerPort: 8080&lt;br /&gt;
            hostPort: 8080&lt;br /&gt;
        envFrom:&lt;br /&gt;
          - configMapRef:&lt;br /&gt;
             name: cs-config&lt;br /&gt;
    volumes:&lt;br /&gt;
      - name: mongodb-data-volume&lt;br /&gt;
        persistentVolumeClaim:&lt;br /&gt;
          claimName: mongodb-data-storage&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example run MongoDB'''&lt;br /&gt;
  podman run \ &lt;br /&gt;
    --detach \ &lt;br /&gt;
    --publish 27017:27017 \&lt;br /&gt;
    --userns=keep-id \ &lt;br /&gt;
    --volume ./mongo-data:/data/db \ &lt;br /&gt;
    --name some-mongo \ &lt;br /&gt;
    mongo:4.4.13 &lt;br /&gt;
  &lt;br /&gt;
  # --detach, -d - Detached mode: run the container in the background and print the new container ID. The default is false&lt;br /&gt;
  # --publish, -p - Publish a container’s port, or range of ports, to the host.&lt;br /&gt;
  # --userns - Because podman runs rootless we need to assign a user that can access the local volumn.  This sets the podman user to the same user who ran the podman command.&lt;br /&gt;
  # --volume, -v - Create a bind mount.&lt;br /&gt;
  # --name - Assign a name to the container.&lt;br /&gt;
&lt;br /&gt;
'''Example running with pods'''&lt;br /&gt;
This is a test to see how apps can talk between each other in a podman network within a pod.&lt;br /&gt;
&lt;br /&gt;
Create the pod&lt;br /&gt;
  podman pod create --userns=keep-id --publish 8080:8080 --name mypod&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --volume ./mongo-data:/data/db --pod mypod --name some-mongo mongo:4.4.13&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --pod mypod --name myapp -e SPRING_DATA_MONGODB_HOST=&amp;quot;localhost&amp;quot; -e CS_DATABASE_MONGODB_EMBEDED_ENABLED=&amp;quot;false&amp;quot; e7b8dd57dec6&lt;br /&gt;
&lt;br /&gt;
  Not used - only for debug&lt;br /&gt;
  podman run -it --pod mypod --name myapp --volume ./config:/config --entrypoint &amp;quot;/bin/sh&amp;quot; e7b8dd57dec6&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Pickling&amp;diff=1179</id>
		<title>Pickling</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Pickling&amp;diff=1179"/>
				<updated>2025-10-21T16:47:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Pickled Jalapeños 1 Cup - Water 1 Cup - Vinegar 2 Tbs - Sugar 1 Tbs - Salt 10 - peppercorns 1 - Bay left 3 - Garlic  Slice Jalapeños, boil ingredients, put all in jar.  Cowb...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pickled Jalapeños&lt;br /&gt;
1 Cup - Water&lt;br /&gt;
1 Cup - Vinegar&lt;br /&gt;
2 Tbs - Sugar&lt;br /&gt;
1 Tbs - Salt&lt;br /&gt;
10 - peppercorns&lt;br /&gt;
1 - Bay left&lt;br /&gt;
3 - Garlic&lt;br /&gt;
&lt;br /&gt;
Slice Jalapeños, boil ingredients, put all in jar.&lt;br /&gt;
&lt;br /&gt;
Cowboy Candy&lt;br /&gt;
1 Cup - Apple Cider Vinegar&lt;br /&gt;
1 Cup - Sugar&lt;br /&gt;
1 Tsp - Garlic Powder&lt;br /&gt;
1/4 Tsp - Turmeric&lt;br /&gt;
&lt;br /&gt;
Boil ingredients, then 5 mins on simmer, back to boil, add jalapeños, boil for 4 mins.  Remove jalapeños, boil until reduced a bit, about 5 mins.  Add mix to jalapeños.  Wait 3-4 weeks, eat.&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Food&amp;diff=1178</id>
		<title>Food</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Food&amp;diff=1178"/>
				<updated>2025-10-21T16:40:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Food Recipes&lt;br /&gt;
----&lt;br /&gt;
[[Hard Boiled Egg]]&lt;br /&gt;
&lt;br /&gt;
[[Collard Greens]]&lt;br /&gt;
&lt;br /&gt;
[[Brussel Sprouts]]&lt;br /&gt;
&lt;br /&gt;
[[Broccoli]]&lt;br /&gt;
&lt;br /&gt;
[[Carrots]]&lt;br /&gt;
&lt;br /&gt;
[[Baked Chicken Legs]]&lt;br /&gt;
&lt;br /&gt;
[[Kick-ass_Vodka...Sauce!]]&lt;br /&gt;
&lt;br /&gt;
[[food_apple_cider|Apple Cider]]&lt;br /&gt;
&lt;br /&gt;
[[food_chex_mix|Chex Mix]]&lt;br /&gt;
&lt;br /&gt;
[[olive_mix|Olive Mix]]&lt;br /&gt;
&lt;br /&gt;
[[beer_cheese_dip|Beer Cheese Dip]]&lt;br /&gt;
&lt;br /&gt;
[[dirty_rice|Dirty Rice]]&lt;br /&gt;
&lt;br /&gt;
[[potato_salad|Potato Salad]]&lt;br /&gt;
&lt;br /&gt;
[[coleslaw|Coleslaw]]&lt;br /&gt;
&lt;br /&gt;
[[pickling|Pickling]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Coleslaw&amp;diff=1177</id>
		<title>Coleslaw</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Coleslaw&amp;diff=1177"/>
				<updated>2025-07-13T00:18:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;1/2 cup milk 1/8 sugar (half 1/4 cup) 1/2 cup mayonnaise  1/2 tablespoon vinegar  Lemon juice Salt &amp;amp; pepper Cabbage  1 carrot A little chopped onions&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1/2 cup milk&lt;br /&gt;
1/8 sugar (half 1/4 cup)&lt;br /&gt;
1/2 cup mayonnaise &lt;br /&gt;
1/2 tablespoon vinegar &lt;br /&gt;
Lemon juice&lt;br /&gt;
Salt &amp;amp; pepper&lt;br /&gt;
Cabbage &lt;br /&gt;
1 carrot&lt;br /&gt;
A little chopped onions&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Food&amp;diff=1176</id>
		<title>Food</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Food&amp;diff=1176"/>
				<updated>2025-07-13T00:15:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Food Recipes&lt;br /&gt;
----&lt;br /&gt;
[[Hard Boiled Egg]]&lt;br /&gt;
&lt;br /&gt;
[[Collard Greens]]&lt;br /&gt;
&lt;br /&gt;
[[Brussel Sprouts]]&lt;br /&gt;
&lt;br /&gt;
[[Broccoli]]&lt;br /&gt;
&lt;br /&gt;
[[Carrots]]&lt;br /&gt;
&lt;br /&gt;
[[Baked Chicken Legs]]&lt;br /&gt;
&lt;br /&gt;
[[Kick-ass_Vodka...Sauce!]]&lt;br /&gt;
&lt;br /&gt;
[[food_apple_cider|Apple Cider]]&lt;br /&gt;
&lt;br /&gt;
[[food_chex_mix|Chex Mix]]&lt;br /&gt;
&lt;br /&gt;
[[olive_mix|Olive Mix]]&lt;br /&gt;
&lt;br /&gt;
[[beer_cheese_dip|Beer Cheese Dip]]&lt;br /&gt;
&lt;br /&gt;
[[dirty_rice|Dirty Rice]]&lt;br /&gt;
&lt;br /&gt;
[[potato_salad|Potato Salad]]&lt;br /&gt;
&lt;br /&gt;
[[coleslaw|Coleslaw]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_poetry&amp;diff=1175</id>
		<title>Python poetry</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_poetry&amp;diff=1175"/>
				<updated>2025-05-30T15:48:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Create new project    poetry init&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Create new project&lt;br /&gt;
   poetry init&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python&amp;diff=1174</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python&amp;diff=1174"/>
				<updated>2025-05-30T15:47:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[python2|Python2]]&lt;br /&gt;
&lt;br /&gt;
[[python3|Python2]]&lt;br /&gt;
&lt;br /&gt;
[[python_ve|Virtual Environment]]&lt;br /&gt;
&lt;br /&gt;
[[python_requirements|Requirements]]&lt;br /&gt;
&lt;br /&gt;
[[python_pyenv|PyEnv]] - Manage python versions.&lt;br /&gt;
&lt;br /&gt;
[[python_pytest|PyTest]]&lt;br /&gt;
&lt;br /&gt;
[[python_pdb|Debug]]&lt;br /&gt;
&lt;br /&gt;
[[python_poetry|Poetry]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1173</id>
		<title>VIM</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1173"/>
				<updated>2025-02-25T17:02:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
Inside VI type the command below.&lt;br /&gt;
&lt;br /&gt;
 :syntax on&lt;br /&gt;
&lt;br /&gt;
Maybe&lt;br /&gt;
&lt;br /&gt;
 :syn on&lt;br /&gt;
&lt;br /&gt;
== Bottom Page ==&lt;br /&gt;
This goes to the bottom of the page.&lt;br /&gt;
 G&lt;br /&gt;
&lt;br /&gt;
== Bookmarks ==&lt;br /&gt;
To bookmark a position press m and then a letter.  Use capital letter for Global or multiple files.&lt;br /&gt;
  ma&lt;br /&gt;
&lt;br /&gt;
To go to the bookmark press ` and then letter marking you want to go to.&lt;br /&gt;
  `a&lt;br /&gt;
&lt;br /&gt;
To see all your bookmarks.&lt;br /&gt;
  :marks&lt;br /&gt;
&lt;br /&gt;
To to last edit location.&lt;br /&gt;
  `.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Record ==&lt;br /&gt;
To record a set of keys press q and then a letter to record to.&lt;br /&gt;
  qa&lt;br /&gt;
&lt;br /&gt;
To play back the recording press @ and then letter marking you want to play back.&lt;br /&gt;
  @a&lt;br /&gt;
&lt;br /&gt;
== Copy &amp;amp; Paste ==&lt;br /&gt;
To yank to a registered key&lt;br /&gt;
  &amp;quot; + {key} + y&lt;br /&gt;
&lt;br /&gt;
To paste from a registered key.&lt;br /&gt;
 &amp;quot; + {key} + p&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
'''Switch''' between windows.  The arrow key or direction key you want to go to.&lt;br /&gt;
  ctrl+w {arrow key} or {h,j,k,l}&lt;br /&gt;
&lt;br /&gt;
Opens a new vertical split&lt;br /&gt;
  CTRL+w, v&lt;br /&gt;
&lt;br /&gt;
Opens a new horizontal split&lt;br /&gt;
  CTRL+w, s&lt;br /&gt;
&lt;br /&gt;
Closes a window but keeps the buffer&lt;br /&gt;
  CTRL+w, c&lt;br /&gt;
&lt;br /&gt;
Closes other windows, keeps the active window only&lt;br /&gt;
  CTRL+w, o&lt;br /&gt;
&lt;br /&gt;
Moves the current window to the right&lt;br /&gt;
  CTRL+w, r&lt;br /&gt;
&lt;br /&gt;
Makes all splits equal size&lt;br /&gt;
  CTRL+w, =&lt;br /&gt;
&lt;br /&gt;
== Show Whitespace ==&lt;br /&gt;
&lt;br /&gt;
This will show all whitespace char&lt;br /&gt;
  set list&lt;br /&gt;
&lt;br /&gt;
You can also show only select char.&lt;br /&gt;
  :set listchars=eol:$,tab:&amp;gt;-,trail:~&lt;br /&gt;
&lt;br /&gt;
== Spelling ==&lt;br /&gt;
To turn spell checker on.&lt;br /&gt;
  :set spell spelllang=en_us&lt;br /&gt;
&lt;br /&gt;
To turn spell checker off.&lt;br /&gt;
  :set nospell&lt;br /&gt;
&lt;br /&gt;
To move between misspelled words.&lt;br /&gt;
  ]s and [s&lt;br /&gt;
&lt;br /&gt;
To get misspelled recommendations, move in misspelled word and press.&lt;br /&gt;
  z=&lt;br /&gt;
&lt;br /&gt;
To add word to dictionary.&lt;br /&gt;
  zg&lt;br /&gt;
&lt;br /&gt;
To mark a word as incorrect&lt;br /&gt;
  zw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Autocomplete ==&lt;br /&gt;
This autocomplete tries to match word already in the document.&lt;br /&gt;
  ctl+n or ctl+p&lt;br /&gt;
&lt;br /&gt;
== Netrw ==&lt;br /&gt;
Open as a left window.&lt;br /&gt;
  :Lexplore or :Lex&lt;br /&gt;
&lt;br /&gt;
Open as a new tab.&lt;br /&gt;
  :tabe .&lt;br /&gt;
&lt;br /&gt;
Open file in new tab when in Netrw.&lt;br /&gt;
  t&lt;br /&gt;
&lt;br /&gt;
Create new file.&lt;br /&gt;
  %&lt;br /&gt;
&lt;br /&gt;
Create new directory.&lt;br /&gt;
  d&lt;br /&gt;
&lt;br /&gt;
Delete file or directory.&lt;br /&gt;
  D&lt;br /&gt;
&lt;br /&gt;
== Terminal ==&lt;br /&gt;
You can open a new terminal by typing.&lt;br /&gt;
  :terminal&lt;br /&gt;
&lt;br /&gt;
You can enter `normal` mode.&lt;br /&gt;
  ctrl-\ ctrl-n&lt;br /&gt;
&lt;br /&gt;
Exit terminal mode&lt;br /&gt;
  ctrl-d&lt;br /&gt;
&lt;br /&gt;
== Pipe in data from console ==&lt;br /&gt;
To pipe in data from the command line use the following&lt;br /&gt;
  :%!{command}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
If you in the terminal and want the output to go into vim.&lt;br /&gt;
  ls | vim -&lt;br /&gt;
&lt;br /&gt;
== Column Editing ==&lt;br /&gt;
Column editing is editing a bunch of lines at once.&lt;br /&gt;
&lt;br /&gt;
  ctrl-v - start highlight of columns.&lt;br /&gt;
  h,j,k,l - to select the columns and/or rows&lt;br /&gt;
  shift-i - to go to insert mode.&lt;br /&gt;
&lt;br /&gt;
== Highlight blocks ==&lt;br /&gt;
To quick highlight blocks of code with in { or [&lt;br /&gt;
&lt;br /&gt;
Move the curser inside the block, and type the following.&lt;br /&gt;
  vi[&lt;br /&gt;
or&lt;br /&gt;
  vi{&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Switch bash to use VIM ==&lt;br /&gt;
This will allow the terminal to use vim keys.&lt;br /&gt;
  set -o vi&lt;br /&gt;
&lt;br /&gt;
== Diff ==&lt;br /&gt;
The following key combinations will show the diff between two copied registries.&lt;br /&gt;
&lt;br /&gt;
  :tabnew // Create a new tab.&lt;br /&gt;
  &amp;quot; -&amp;gt; a -&amp;gt; p  // Paste the text from registry 'a'&lt;br /&gt;
  leftabove vnew diff1.  // create a side window called diff1&lt;br /&gt;
  &lt;br /&gt;
  ctr+w -&amp;gt;&amp;gt;  // switch windows&lt;br /&gt;
  &lt;br /&gt;
  &amp;quot; -&amp;gt; b -&amp;gt; p // paste the text from registry 'b'&lt;br /&gt;
  ctr+w &amp;lt;&amp;lt;-  // Switch windows again&lt;br /&gt;
  :diffthis  // diff the two windows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Buffer ==&lt;br /&gt;
List all buffers&lt;br /&gt;
  :ls&lt;br /&gt;
&lt;br /&gt;
Open a buffer&lt;br /&gt;
  :buffer {number from above}&lt;br /&gt;
&lt;br /&gt;
Open a buffer in a new tab&lt;br /&gt;
  :tab sb {number from above}&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=NetCat&amp;diff=1172</id>
		<title>NetCat</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=NetCat&amp;diff=1172"/>
				<updated>2025-02-04T20:01:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redirect ports.&lt;br /&gt;
&lt;br /&gt;
This one redirect port 24 to port 22.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;24		stream 	tcp	nowait	nobody	/usr/sbin/tcpd /bin/nc 192.168.1.1 22&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one redirects port 6000(x11) to port 25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;x11             stream  tcp     nowait  root    /usr/local/bin/nc      nc -n -w 3  127.0.0.1 25&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Start a chat ==&lt;br /&gt;
host computer - 10.0.0.1&lt;br /&gt;
  nc -l 8001&lt;br /&gt;
&lt;br /&gt;
remote computer - 10.0.0.2&lt;br /&gt;
  nc 10.0.0.1 8001&lt;br /&gt;
&lt;br /&gt;
and then start typing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Send a file ==&lt;br /&gt;
This will send a file to another computer on the same network&lt;br /&gt;
&lt;br /&gt;
hosted file computer - 10.0.0.1&lt;br /&gt;
  cat file.doc | nc 10.0.0.2 8001&lt;br /&gt;
&lt;br /&gt;
remote file to receive the file&lt;br /&gt;
  nc -l 8001 &amp;gt; file.doc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reverse Shell ==&lt;br /&gt;
This create a shell for a client to use.&lt;br /&gt;
&lt;br /&gt;
hosted computer to get the shell from&lt;br /&gt;
  nc 127.0.0.1 1234 –e /bin/bash&lt;br /&gt;
&lt;br /&gt;
remote computer to use the shell&lt;br /&gt;
  nc -l -p 1234&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Shell Listener ==&lt;br /&gt;
This creates a listener shell, at which point any client can connect to and use the shell.&lt;br /&gt;
&lt;br /&gt;
The host computer with the shell to access.&lt;br /&gt;
  nc –l –p 1234 –e /bin/bash&lt;br /&gt;
&lt;br /&gt;
Connect to the host computer with the following command.&lt;br /&gt;
  nc 127.0.0.1 1234&lt;br /&gt;
&lt;br /&gt;
Side note:  You can create a simple script and run this with nohup in the background to insure this continues running.&lt;br /&gt;
  nohup ./script.sh &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You can also pipe all commands into bash&lt;br /&gt;
  nc -l 1234 | /bin/bash&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Keep Listening ==&lt;br /&gt;
Continue listening after a connection is closed use the -k option.&lt;br /&gt;
  nc -k -l 1234&lt;br /&gt;
&lt;br /&gt;
== Echo everything that http requests ==&lt;br /&gt;
  nc -kdl 8000&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1171</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1171"/>
				<updated>2024-12-04T20:20:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To debug python applications use the library pdb.&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your file.&lt;br /&gt;
&lt;br /&gt;
  import pdb&lt;br /&gt;
&lt;br /&gt;
To add a breakpoint in the python use&lt;br /&gt;
  pdb.set_trace()&lt;br /&gt;
  or&lt;br /&gt;
  breakpoint() # 3.7 for higher&lt;br /&gt;
&lt;br /&gt;
And then just add the following to your command.&lt;br /&gt;
  --pdb&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  pytest --pdb test/test.py&lt;br /&gt;
&lt;br /&gt;
Once it starts up you will be brought to a promote.&lt;br /&gt;
From the there you can use any of the following.&lt;br /&gt;
&lt;br /&gt;
Navigating Code (within the Pdb interpreter)&lt;br /&gt;
  l(ist)   list 11 lines surrounding the current line&lt;br /&gt;
  l .      list the current location&lt;br /&gt;
  w(here)  display the file and line number of the current line&lt;br /&gt;
  n(ext)   execute the current line&lt;br /&gt;
  s(tep)   step into functions called at the current line&lt;br /&gt;
  r(eturn) execute until the current function’s return is encountered&lt;br /&gt;
&lt;br /&gt;
Controlling Execution&lt;br /&gt;
  b[#]       create a breakpoint at line [#]&lt;br /&gt;
  b          list breakpoints and their indices&lt;br /&gt;
  c(ontinue) execute until a breakpoint is encountered&lt;br /&gt;
  clear[#]   clear breakpoint of index [#]&lt;br /&gt;
&lt;br /&gt;
Changing Variables / Interacting with Code&lt;br /&gt;
  p&amp;lt;name&amp;gt; print value of the variable &amp;lt;name&amp;gt;&lt;br /&gt;
  !&amp;lt;expr&amp;gt; execute the expression &amp;lt;expr&amp;gt; NOTE: this acts just like a python interpreter&lt;br /&gt;
  q(uit)  exit the debugger&lt;br /&gt;
&lt;br /&gt;
Example Command&lt;br /&gt;
  poetry run pytest -o log_cli=true --log-cli-level=INFO -v tests/functions/test_function.py::TestOne::test_one --pdb --no-cov&lt;br /&gt;
&lt;br /&gt;
Issues&lt;br /&gt;
If pdb is breaking in the wrong location try adding the following flag.&lt;br /&gt;
  --no-cov&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1170</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1170"/>
				<updated>2024-12-03T16:04:15Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To debug python applications use the library pdb.&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your file.&lt;br /&gt;
&lt;br /&gt;
  import pdb&lt;br /&gt;
&lt;br /&gt;
To add a breakpoint in the python use&lt;br /&gt;
  pdb.set_trace()&lt;br /&gt;
  or&lt;br /&gt;
  breakpoint() # 3.7 for higher&lt;br /&gt;
&lt;br /&gt;
And then just add the following to your command.&lt;br /&gt;
  --pdb&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  pytest --pdb test/test.py&lt;br /&gt;
&lt;br /&gt;
Once it starts up you will be brought to a promote.&lt;br /&gt;
From the there you can use any of the following.&lt;br /&gt;
&lt;br /&gt;
Navigating Code (within the Pdb interpreter)&lt;br /&gt;
  l(ist)   list 11 lines surrounding the current line&lt;br /&gt;
  l .      list the current location&lt;br /&gt;
  w(here)  display the file and line number of the current line&lt;br /&gt;
  n(ext)   execute the current line&lt;br /&gt;
  s(tep)   step into functions called at the current line&lt;br /&gt;
  r(eturn) execute until the current function’s return is encountered&lt;br /&gt;
&lt;br /&gt;
Controlling Execution&lt;br /&gt;
  b[#]       create a breakpoint at line [#]&lt;br /&gt;
  b          list breakpoints and their indices&lt;br /&gt;
  c(ontinue) execute until a breakpoint is encountered&lt;br /&gt;
  clear[#]   clear breakpoint of index [#]&lt;br /&gt;
&lt;br /&gt;
Changing Variables / Interacting with Code&lt;br /&gt;
  p&amp;lt;name&amp;gt; print value of the variable &amp;lt;name&amp;gt;&lt;br /&gt;
  !&amp;lt;expr&amp;gt; execute the expression &amp;lt;expr&amp;gt; NOTE: this acts just like a python interpreter&lt;br /&gt;
  q(uit)  exit the debugger&lt;br /&gt;
&lt;br /&gt;
Issues&lt;br /&gt;
If pdb is breaking in the wrong location try adding the following flag.&lt;br /&gt;
  --no-cov&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1169</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1169"/>
				<updated>2024-11-04T19:56:31Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Database Connection ==&lt;br /&gt;
This is a way to test the database connection.&lt;br /&gt;
  ./pg_isready -h localhost -p 5432&lt;br /&gt;
&lt;br /&gt;
== Application Structure ==&lt;br /&gt;
Log location&lt;br /&gt;
 ./data/log/&lt;br /&gt;
&lt;br /&gt;
== OSX ==&lt;br /&gt;
The Postgres app live here on OSX&lt;br /&gt;
  /Library/PostgreSQL/11&lt;br /&gt;
&lt;br /&gt;
Start&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data start&lt;br /&gt;
&lt;br /&gt;
Stop&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
FYI, haven't tried but look like a nicer app to control Postgres is https://postgresapp.com.&lt;br /&gt;
&lt;br /&gt;
If you are not using the system registered database you can all simply use the following commands.&lt;br /&gt;
&lt;br /&gt;
  pg_ctl -D ./data start&lt;br /&gt;
  pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
== Initialize a database directory ==&lt;br /&gt;
To initialize a database directory use the following command.&lt;br /&gt;
&lt;br /&gt;
  initdb -D &amp;lt;data_directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Environment Path ==&lt;br /&gt;
To add PostgreSQL in to your environment path.&lt;br /&gt;
&lt;br /&gt;
  export POSTGRESQL_HOME=/Library/PostgreSQL/11&lt;br /&gt;
  PATH=$PATH:$POSTGRESQL_HOME/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
You can start Postgres in Debian using&lt;br /&gt;
  /etc/init.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
Create a database and user&lt;br /&gt;
  sudo su - postgres&lt;br /&gt;
  createdb testdb&lt;br /&gt;
  createuser testdb&lt;br /&gt;
&lt;br /&gt;
To create a password for the user either use&lt;br /&gt;
  createuser testdb --pwprompt&lt;br /&gt;
or&lt;br /&gt;
  psql&lt;br /&gt;
  ALTER USER 'testdb' WITH PASSWORD 'testdb';&lt;br /&gt;
&lt;br /&gt;
To have the new user be a superuser add the following.&lt;br /&gt;
  createuser --superuser testdb --pwprompt&lt;br /&gt;
&lt;br /&gt;
== Run file and commands from CLI ==&lt;br /&gt;
PSQL will ask for your password every time unless you set it as an environment variable.&lt;br /&gt;
  export PGPASSWORD=Password123&lt;br /&gt;
&lt;br /&gt;
To run a command.&lt;br /&gt;
  psql -U user_name -d database_name -c &amp;quot;SELECT * FROM tblExample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To run a file.&lt;br /&gt;
  psql -U user_name -d database_name -f ./file.sql&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
Error Connecting to database FATAL : no pg_hba.conf entry for host&lt;br /&gt;
I had to add the host ip address into the pg_hba.conf file.&lt;br /&gt;
&lt;br /&gt;
location of file: ./data/pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Added the following line and then restarted Postgres.&lt;br /&gt;
  host    all             all             10.225.41.95/24        md5&lt;br /&gt;
&lt;br /&gt;
== Describe a table ==&lt;br /&gt;
You can query the 'information_schema.columns' table to find internal table information.&lt;br /&gt;
&lt;br /&gt;
This is a sample command to find information about a table.&lt;br /&gt;
  SELECT table_name, column_name, data_type&lt;br /&gt;
  FROM information_schema.columns&lt;br /&gt;
  WHERE table_name='TABLE_A';&lt;br /&gt;
&lt;br /&gt;
== Top 10 rows ==&lt;br /&gt;
This is to get the top 10 rows.&lt;br /&gt;
  select *&lt;br /&gt;
  from table_a&lt;br /&gt;
  fetch first 10 rows only;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== PSQL VIM ==&lt;br /&gt;
Tips for editing script and running them in th PSQL command.&lt;br /&gt;
&lt;br /&gt;
1. Edit a script in vim.  Once logged in use the following command.&lt;br /&gt;
  \e&lt;br /&gt;
&lt;br /&gt;
2. Multiple windows.&lt;br /&gt;
In 1 window connect using the psql tool and run scripts using the following command.&lt;br /&gt;
  \o ./sql.out \i ./test.sql&lt;br /&gt;
&lt;br /&gt;
In 2 window using VIM, edit the test.sql file and open a new tab of sql.out.&lt;br /&gt;
Then refresh the buffer using &lt;br /&gt;
  :e&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Linux_gpg&amp;diff=1168</id>
		<title>Linux gpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Linux_gpg&amp;diff=1168"/>
				<updated>2024-10-30T16:50:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Import Public/Private Key ==&lt;br /&gt;
It doesn't make a difference if its a private key or public key, this is the correct way to import a key.&lt;br /&gt;
  gpg --import file.gpg&lt;br /&gt;
&lt;br /&gt;
== Export Public Key ==&lt;br /&gt;
&lt;br /&gt;
This is the command to export your public key, using the armor command will convert the key from binary to ascii, so you can email it or post it.&lt;br /&gt;
&lt;br /&gt;
  gpg --armor --export you@example.com &amp;gt; mykey.asc&lt;br /&gt;
&lt;br /&gt;
Another way&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_pub.gpg --armor --export me@email.com&lt;br /&gt;
&lt;br /&gt;
If you have more then one key another way where ABAACA is the hash.&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_pub.gpg --armor --export ABAACA&lt;br /&gt;
&lt;br /&gt;
Export a base64 output of your public key.&lt;br /&gt;
  gpg --export me@email.com | base64&lt;br /&gt;
&lt;br /&gt;
== Export Private Key ==&lt;br /&gt;
To export your private key.&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_sec.gpg --armor --export-secret-key me@email.com&lt;br /&gt;
&lt;br /&gt;
another way, where ABAACA is the hash&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_sec.gpg --armor --export-secret-key ABAACA&lt;br /&gt;
&lt;br /&gt;
Base64 export of your private key.&lt;br /&gt;
   gpg --export-secret-key me@email.com | base64&lt;br /&gt;
&lt;br /&gt;
== List Keys ==&lt;br /&gt;
To see a list of all the keys in the system.&lt;br /&gt;
&lt;br /&gt;
  gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
== Sign a file ==&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig that will contain both the file and the signature. &lt;br /&gt;
  gpg --clear-sig --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig that contains an ascii file with just the signature.&lt;br /&gt;
  gpg --detach-sign --armor --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig with a binary signature.&lt;br /&gt;
  gpg --detach-sign --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create an binary file with a signature and original document.&lt;br /&gt;
  gpg --sign --output text.txt.sig text.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Backup ==&lt;br /&gt;
I read somewhere to back up the GPG file system, you can just copy ~/. gnupg but I have not tried this before.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
https://www.debuntu.org/how-to-importexport-gpg-key-pair/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encrypt a File with Password ==&lt;br /&gt;
To encrypt a file with a password with gpg use the following&lt;br /&gt;
  gpg -c filename&lt;br /&gt;
&lt;br /&gt;
This will create a new encrypted file with the extension .gpg, you can delete the unencrypted file.&lt;br /&gt;
&lt;br /&gt;
To decrypt the file.&lt;br /&gt;
  gpg -d filename&lt;br /&gt;
&lt;br /&gt;
== Encrypt a File from user key ==&lt;br /&gt;
&lt;br /&gt;
Encrypt the file.&lt;br /&gt;
  gpg --encrypt --user john.doe@email.com key.dv&lt;br /&gt;
&lt;br /&gt;
decrypt the file to a bash variable.&lt;br /&gt;
  export PGPASSWORD=$(cat $v_password | gpg --decrypt --user john.do@email.com)&lt;br /&gt;
&lt;br /&gt;
== Extend the expiration date of a key ==&lt;br /&gt;
If you key expires you can extend the expiration date of the key&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  gpg --quick-set-expire {key_id} {extended_amount}&lt;br /&gt;
&lt;br /&gt;
key_id=the key id&lt;br /&gt;
extended_amount=The amount of time to add, d, m, y&lt;br /&gt;
&lt;br /&gt;
example&lt;br /&gt;
  gpg --quick-set-expire 38D3CD66D0671E54B78001B43FD6190BCDE08D11 2y&lt;br /&gt;
&lt;br /&gt;
https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Apache&amp;diff=1167</id>
		<title>Apache</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Apache&amp;diff=1167"/>
				<updated>2024-07-31T18:33:42Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Virtual Host ==&lt;br /&gt;
This is how you setup apache for Virual Hosts. example if you have more domain names and only one server.&lt;br /&gt;
The serverAlias is used in case people don't put in the &amp;quot;www&amp;quot; before the URL.&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
         DocumentRoot /home/{user}/public_html&lt;br /&gt;
         ServerName www.{domainname}.com&lt;br /&gt;
         ServerAlias {domainname}.com&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Virtual Host ProxyPass ==&lt;br /&gt;
This will pass any http request along.  It helps when you want to pass a connection to another server, example apache -&amp;gt; tomcat:8080.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
         ProxyPreserveHost On&lt;br /&gt;
         ProxyPass / http://localhost:8080/&lt;br /&gt;
         ProxyPassReverse / http://localhost:8080/&lt;br /&gt;
         ServerName www.{domainname}.com&lt;br /&gt;
         ServerAlias {domainname}.com&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SSL Setup ==&lt;br /&gt;
&lt;br /&gt;
I'm playing around with SSL setup for Apache.  My overall goal would be to set up an SSL web address that would be only accessed with a single private key that would have to be imported into a browser and not handed off from the server.&lt;br /&gt;
&lt;br /&gt;
1. Install SSL module for Apache on Fedora&lt;br /&gt;
  yum install mod_ssl&lt;br /&gt;
&lt;br /&gt;
2. I create a folder for housing any newly created certs to be used by Apache.&lt;br /&gt;
  mkdir /etc/httpd/ssl&lt;br /&gt;
&lt;br /&gt;
*.key = Key file kind of like a password.&lt;br /&gt;
*.csr = Certificate Signing Request, this is the built request to generate a certificate.&lt;br /&gt;
*.crt = Certificate&lt;br /&gt;
*.pem = Bundle of key, and certificates.&lt;br /&gt;
*.p12 = a combo file of key and cert.&lt;br /&gt;
&lt;br /&gt;
1. Create files for openssl to use for records.&lt;br /&gt;
index.txt is an openssl database file.&lt;br /&gt;
&lt;br /&gt;
  touch index.txt&lt;br /&gt;
  echo 1000 &amp;gt; serial&lt;br /&gt;
&lt;br /&gt;
2. Create the private key for the CA ROOT certification.  &lt;br /&gt;
&lt;br /&gt;
  # openssl genrsa -aes256 -out /etc/pki/CA/private/ca.key 4096&lt;br /&gt;
  &lt;br /&gt;
  Enter pass phrase for ca.key: secretpassword&lt;br /&gt;
  Verifying - Enter pass phrase for ca.key: secretpassword&lt;br /&gt;
  &lt;br /&gt;
  # chmod 400 /etc/pki/CA/private/ca.key&lt;br /&gt;
&lt;br /&gt;
3.  Double check configs.  I needed to uncomment out some.&lt;br /&gt;
&lt;br /&gt;
Open your OpenSSL configuration file (/etc/pki/tls/openssl.cnf) and look for the [ usr_cert ] and [ v3_ca ] sections. Make sure they contain the following options:&lt;br /&gt;
&lt;br /&gt;
  [ usr_cert ]&lt;br /&gt;
  # These extensions are added when 'ca' signs a request.&lt;br /&gt;
  basicConstraints=CA:FALSE&lt;br /&gt;
  keyUsage = nonRepudiation, digitalSignature, keyEncipherment&lt;br /&gt;
  nsComment = &amp;quot;OpenSSL Generated Certificate&amp;quot;&lt;br /&gt;
  subjectKeyIdentifier=hash&lt;br /&gt;
  authorityKeyIdentifier=keyid,issuer&lt;br /&gt;
  &lt;br /&gt;
  [ v3_ca ]&lt;br /&gt;
  # Extensions for a typical CA&lt;br /&gt;
  subjectKeyIdentifier=hash&lt;br /&gt;
  authorityKeyIdentifier=keyid:always,issuer&lt;br /&gt;
  basicConstraints = CA:true&lt;br /&gt;
  keyUsage = cRLSign, keyCertSign&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Create a CA certificate from your CA key.&lt;br /&gt;
&lt;br /&gt;
Now you can use the root key above to issue a root certificate (ca.crt). In this example, the certificate is set to expire in ten years. As this is a CA certificate, use the v3_ca extension. You will be prompted for some responses, which you can fill with whatever you like. For convenience, defaults can be set in the openssl configuration file.&lt;br /&gt;
&lt;br /&gt;
Important: The default digest is SHA-1. SHA-1 is considered insecure. Pass the -sha256 option to use a more secure digest.&lt;br /&gt;
&lt;br /&gt;
Make sure the common name matches your server name, wiki.johnfreier.com.&lt;br /&gt;
&lt;br /&gt;
  openssl req -new -x509 -days 3650 -key /etc/pki/CA/private/ca.key -sha256 -extensions v3_ca -out /etc/pki/CA/certs/ca.crt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Enter pass phrase for ca.key:&lt;br /&gt;
  You are about to be asked to enter information that will be incorporated&lt;br /&gt;
  into your certificate request.&lt;br /&gt;
  -----&lt;br /&gt;
  Country Name (2 letter code) [XX]:GB&lt;br /&gt;
  State or Province Name (full name) []:London&lt;br /&gt;
  Locality Name (eg, city) [Default City]:London&lt;br /&gt;
  Organization Name (eg, company) [Default Company Ltd]:Alice CA&lt;br /&gt;
  Organizational Unit Name (eg, section) []:Certificate Authority&lt;br /&gt;
  Common Name (eg, your name or your server's hostname) []:Alice CA&lt;br /&gt;
  Email Address []:alice@example.com&lt;br /&gt;
&lt;br /&gt;
  chmod 444 /etc/pki/CA/certs/ca.crt&lt;br /&gt;
&lt;br /&gt;
 Root key: ca.key&lt;br /&gt;
 Root certificate: ca.cert&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Generate Signing Request Key.  This creates a signing request key that is used to verify things.&lt;br /&gt;
&lt;br /&gt;
  openssl genrsa -out footballaz.key 4096&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Create a certificate signing request (csr) - Make sure that the '''Organization Name''' you choose below matches the one set for your CA root certificate. The extra attributes can be left blank. If you are creating a self-signed certificate, you would also use the -x509 and -days options.&lt;br /&gt;
&lt;br /&gt;
I did not use -x509 or -days not sure what i missed???&lt;br /&gt;
&lt;br /&gt;
  openssl req -sha256 -new -key footballaz.key -out footballaz.csr&lt;br /&gt;
&lt;br /&gt;
3. Create Certificate&lt;br /&gt;
&lt;br /&gt;
  openssl ca -keyfile /etc/pki/CA/private/ca.key -cert /etc/pki/CA/certs/ca.crt -extensions usr_cert -notext -md sha256 -in footballaz.csr -out footballaz.crt&lt;br /&gt;
&lt;br /&gt;
4. Verify new certificate&lt;br /&gt;
&lt;br /&gt;
  openssl verify -CAfile /etc/pki/CA/certs/ca.crt footballaz.crt&lt;br /&gt;
&lt;br /&gt;
Need to generate a *.p12 certificate.  Which is a special combination cert that is password protected.  This one is need by the browser to get to the site.&lt;br /&gt;
&lt;br /&gt;
  openssl pkcs12 -export -in footballaz.crt -inkey footballaz.key -out footballaz.p12&lt;br /&gt;
&lt;br /&gt;
5. Install the *.p12 file in a browser or computer and....&lt;br /&gt;
&lt;br /&gt;
It WORKED!!!&lt;br /&gt;
&lt;br /&gt;
These were extra SSL properties I needed to get it to work correctly.&lt;br /&gt;
  &amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
  	SSLEngine on&lt;br /&gt;
  	SSLCertificateFile /etc/httpd/ssl/footballaz.crt&lt;br /&gt;
  	SSLCertificateKeyFile /etc/httpd/ssl/footballaz.key&lt;br /&gt;
  	SSLCACertificateFile {path_to_ca}/ca.crt&lt;br /&gt;
  	SSLVerifyClient require&lt;br /&gt;
  	SSLVerifyDepth	2 &lt;br /&gt;
  	SSLProtocol all -SSLv2 -SSLv3&lt;br /&gt;
  	SSLHonorCipherOrder On&lt;br /&gt;
  	SSLCipherSuite          ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA&lt;br /&gt;
  &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
Resources&lt;br /&gt;
&lt;br /&gt;
https://jamielinux.com/articles/2013/08/act-as-your-own-certificate-authority/&lt;br /&gt;
&lt;br /&gt;
http://linuxconfig.org/apache-web-server-ssl-authentication&lt;br /&gt;
&lt;br /&gt;
http://cs.uccs.edu/~cs526/secureWebAccess/secureWebAccess.htm&lt;br /&gt;
&lt;br /&gt;
http://www.apachelounge.com/viewtopic.php?t=3571&lt;br /&gt;
&lt;br /&gt;
https://www.linode.com/docs/security/ssl/ssl-certificates-with-apache-2-on-fedora-14&lt;br /&gt;
&lt;br /&gt;
== SSL (StartSSL) ==&lt;br /&gt;
This is a free SSL certificate issue https://www.startssl.com&lt;br /&gt;
&lt;br /&gt;
Follow the steps.&lt;br /&gt;
&lt;br /&gt;
for my configuration I needed www.johnfreier.com as the common name.&lt;br /&gt;
&lt;br /&gt;
After you follow the steps you will get a zip file with a bunch of *.crt files in folders.&lt;br /&gt;
You will want to unzip the ApacheBundle.zip&lt;br /&gt;
&lt;br /&gt;
Use this configuration: https://www.startssl.com/Support?v=21&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # openssl rsa -in www.key -out new.key&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes on updating crt ==&lt;br /&gt;
1. Paste current johnfreier.com csr to website that issues the new crt.&lt;br /&gt;
2. The new crt gets emailed, just replace it.&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1166</id>
		<title>VIM</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1166"/>
				<updated>2024-07-09T21:53:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
Inside VI type the command below.&lt;br /&gt;
&lt;br /&gt;
 :syntax on&lt;br /&gt;
&lt;br /&gt;
Maybe&lt;br /&gt;
&lt;br /&gt;
 :syn on&lt;br /&gt;
&lt;br /&gt;
== Bottom Page ==&lt;br /&gt;
This goes to the bottom of the page.&lt;br /&gt;
 G&lt;br /&gt;
&lt;br /&gt;
== Bookmarks ==&lt;br /&gt;
To bookmark a position press m and then a letter.  Use capital letter for Global or multiple files.&lt;br /&gt;
  ma&lt;br /&gt;
&lt;br /&gt;
To go to the bookmark press ` and then letter marking you want to go to.&lt;br /&gt;
  `a&lt;br /&gt;
&lt;br /&gt;
To see all your bookmarks.&lt;br /&gt;
  :marks&lt;br /&gt;
&lt;br /&gt;
To to last edit location.&lt;br /&gt;
  `.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Record ==&lt;br /&gt;
To record a set of keys press q and then a letter to record to.&lt;br /&gt;
  qa&lt;br /&gt;
&lt;br /&gt;
To play back the recording press @ and then letter marking you want to play back.&lt;br /&gt;
  @a&lt;br /&gt;
&lt;br /&gt;
== Copy &amp;amp; Paste ==&lt;br /&gt;
To yank to a registered key&lt;br /&gt;
  &amp;quot; + {key} + y&lt;br /&gt;
&lt;br /&gt;
To paste from a registered key.&lt;br /&gt;
 &amp;quot; + {key} + p&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
'''Switch''' between windows.  The arrow key or direction key you want to go to.&lt;br /&gt;
  ctrl+w {arrow key} or {h,j,k,l}&lt;br /&gt;
&lt;br /&gt;
Opens a new vertical split&lt;br /&gt;
  CTRL+w, v&lt;br /&gt;
&lt;br /&gt;
Opens a new horizontal split&lt;br /&gt;
  CTRL+w, s&lt;br /&gt;
&lt;br /&gt;
Closes a window but keeps the buffer&lt;br /&gt;
  CTRL+w, c&lt;br /&gt;
&lt;br /&gt;
Closes other windows, keeps the active window only&lt;br /&gt;
  CTRL+w, o&lt;br /&gt;
&lt;br /&gt;
Moves the current window to the right&lt;br /&gt;
  CTRL+w, r&lt;br /&gt;
&lt;br /&gt;
Makes all splits equal size&lt;br /&gt;
  CTRL+w, =&lt;br /&gt;
&lt;br /&gt;
== Show Whitespace ==&lt;br /&gt;
&lt;br /&gt;
This will show all whitespace char&lt;br /&gt;
  set list&lt;br /&gt;
&lt;br /&gt;
You can also show only select char.&lt;br /&gt;
  :set listchars=eol:$,tab:&amp;gt;-,trail:~&lt;br /&gt;
&lt;br /&gt;
== Spelling ==&lt;br /&gt;
To turn spell checker on.&lt;br /&gt;
  :set spell spelllang=en_us&lt;br /&gt;
&lt;br /&gt;
To turn spell checker off.&lt;br /&gt;
  :set nospell&lt;br /&gt;
&lt;br /&gt;
To move between misspelled words.&lt;br /&gt;
  ]s and [s&lt;br /&gt;
&lt;br /&gt;
To get misspelled recommendations, move in misspelled word and press.&lt;br /&gt;
  z=&lt;br /&gt;
&lt;br /&gt;
To add word to dictionary.&lt;br /&gt;
  zg&lt;br /&gt;
&lt;br /&gt;
To mark a word as incorrect&lt;br /&gt;
  zw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Autocomplete ==&lt;br /&gt;
This autocomplete tries to match word already in the document.&lt;br /&gt;
  ctl+n or ctl+p&lt;br /&gt;
&lt;br /&gt;
== Netrw ==&lt;br /&gt;
Open as a left window.&lt;br /&gt;
  :Lexplore or :Lex&lt;br /&gt;
&lt;br /&gt;
Open as a new tab.&lt;br /&gt;
  :tabe .&lt;br /&gt;
&lt;br /&gt;
Open file in new tab when in Netrw.&lt;br /&gt;
  t&lt;br /&gt;
&lt;br /&gt;
Create new file.&lt;br /&gt;
  %&lt;br /&gt;
&lt;br /&gt;
Create new directory.&lt;br /&gt;
  d&lt;br /&gt;
&lt;br /&gt;
Delete file or directory.&lt;br /&gt;
  D&lt;br /&gt;
&lt;br /&gt;
== Terminal ==&lt;br /&gt;
You can open a new terminal by typing.&lt;br /&gt;
  :terminal&lt;br /&gt;
&lt;br /&gt;
You can enter `normal` mode.&lt;br /&gt;
  ctrl-\ ctrl-n&lt;br /&gt;
&lt;br /&gt;
Exit terminal mode&lt;br /&gt;
  ctrl-d&lt;br /&gt;
&lt;br /&gt;
== Pipe in data from console ==&lt;br /&gt;
To pipe in data from the command line use the following&lt;br /&gt;
  :%!{command}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
If you in the terminal and want the output to go into vim.&lt;br /&gt;
  ls | vim -&lt;br /&gt;
&lt;br /&gt;
== Column Editing ==&lt;br /&gt;
Column editing is editing a bunch of lines at once.&lt;br /&gt;
&lt;br /&gt;
  ctrl-v - start highlight of columns.&lt;br /&gt;
  h,j,k,l - to select the columns and/or rows&lt;br /&gt;
  shift-i - to go to insert mode.&lt;br /&gt;
&lt;br /&gt;
== Highlight blocks ==&lt;br /&gt;
To quick highlight blocks of code with in { or [&lt;br /&gt;
&lt;br /&gt;
Move the curser inside the block, and type the following.&lt;br /&gt;
  vi[&lt;br /&gt;
or&lt;br /&gt;
  vi{&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Switch bash to use VIM ==&lt;br /&gt;
This will allow the terminal to use vim keys.&lt;br /&gt;
  set -o vi&lt;br /&gt;
&lt;br /&gt;
== Diff ==&lt;br /&gt;
The following key combinations will show the diff between two copied registries.&lt;br /&gt;
&lt;br /&gt;
  :tabnew // Create a new tab.&lt;br /&gt;
  &amp;quot; -&amp;gt; a -&amp;gt; p  // Paste the text from registry 'a'&lt;br /&gt;
  leftabove vnew diff1.  // create a side window called diff1&lt;br /&gt;
  &lt;br /&gt;
  ctr+w -&amp;gt;&amp;gt;  // switch windows&lt;br /&gt;
  &lt;br /&gt;
  &amp;quot; -&amp;gt; b -&amp;gt; p // paste the text from registry 'b'&lt;br /&gt;
  ctr+w &amp;lt;&amp;lt;-  // Switch windows again&lt;br /&gt;
  :diffthis  // diff the two windows&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Splunk&amp;diff=1165</id>
		<title>Splunk</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Splunk&amp;diff=1165"/>
				<updated>2024-07-02T19:46:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Get the line result count.&lt;br /&gt;
   host=server01 Error | stats sum(linecount) as Total&lt;br /&gt;
&lt;br /&gt;
Get result count per day or hour&lt;br /&gt;
  host=server01 Error | bucket _time span=hour |stats count by _time&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1164</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1164"/>
				<updated>2024-05-29T13:22:37Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To debug python applications use the library pdb.&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your file.&lt;br /&gt;
&lt;br /&gt;
  import pdb&lt;br /&gt;
&lt;br /&gt;
To add a breakpoint in the python use&lt;br /&gt;
  pdb.set_trace()&lt;br /&gt;
  or&lt;br /&gt;
  breakpoint() # 3.7 for higher&lt;br /&gt;
&lt;br /&gt;
And then just add the following to your command.&lt;br /&gt;
  --pdb&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  pytest --pdb test/test.py&lt;br /&gt;
&lt;br /&gt;
Once it starts up you will be brought to a promote.&lt;br /&gt;
From the there you can use any of the following.&lt;br /&gt;
&lt;br /&gt;
Navigating Code (within the Pdb interpreter)&lt;br /&gt;
  l(ist)   list 11 lines surrounding the current line&lt;br /&gt;
  l .      list the current location&lt;br /&gt;
  w(here)  display the file and line number of the current line&lt;br /&gt;
  n(ext)   execute the current line&lt;br /&gt;
  s(tep)   step into functions called at the current line&lt;br /&gt;
  r(eturn) execute until the current function’s return is encountered&lt;br /&gt;
&lt;br /&gt;
Controlling Execution&lt;br /&gt;
  b[#]       create a breakpoint at line [#]&lt;br /&gt;
  b          list breakpoints and their indices&lt;br /&gt;
  c(ontinue) execute until a breakpoint is encountered&lt;br /&gt;
  clear[#]   clear breakpoint of index [#]&lt;br /&gt;
&lt;br /&gt;
Changing Variables / Interacting with Code&lt;br /&gt;
  p&amp;lt;name&amp;gt; print value of the variable &amp;lt;name&amp;gt;&lt;br /&gt;
  !&amp;lt;expr&amp;gt; execute the expression &amp;lt;expr&amp;gt; NOTE: this acts just like a python interpreter&lt;br /&gt;
  q(uit)  exit the debugger&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1163</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1163"/>
				<updated>2024-05-28T20:44:05Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To debug python applications use the library pdb.&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your file.&lt;br /&gt;
&lt;br /&gt;
  import pdb&lt;br /&gt;
  pdb.set_trace()&lt;br /&gt;
&lt;br /&gt;
And then just add the following to your command.&lt;br /&gt;
  --pdb&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  pytest --pdb test/test.py&lt;br /&gt;
&lt;br /&gt;
Once it starts up you will be brought to a promote.&lt;br /&gt;
From the there you can use any of the following.&lt;br /&gt;
&lt;br /&gt;
Navigating Code (within the Pdb interpreter)&lt;br /&gt;
  l(ist)   list 11 lines surrounding the current line&lt;br /&gt;
  l .      list the current location&lt;br /&gt;
  w(here)  display the file and line number of the current line&lt;br /&gt;
  n(ext)   execute the current line&lt;br /&gt;
  s(tep)   step into functions called at the current line&lt;br /&gt;
  r(eturn) execute until the current function’s return is encountered&lt;br /&gt;
&lt;br /&gt;
Controlling Execution&lt;br /&gt;
  b[#]       create a breakpoint at line [#]&lt;br /&gt;
  b          list breakpoints and their indices&lt;br /&gt;
  c(ontinue) execute until a breakpoint is encountered&lt;br /&gt;
  clear[#]   clear breakpoint of index [#]&lt;br /&gt;
&lt;br /&gt;
Changing Variables / Interacting with Code&lt;br /&gt;
  p&amp;lt;name&amp;gt; print value of the variable &amp;lt;name&amp;gt;&lt;br /&gt;
  !&amp;lt;expr&amp;gt; execute the expression &amp;lt;expr&amp;gt; NOTE: this acts just like a python interpreter&lt;br /&gt;
  q(uit)  exit the debugger&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add a breakpoint in the python.&lt;br /&gt;
  breakpoint()&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pytest&amp;diff=1162</id>
		<title>Python pytest</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pytest&amp;diff=1162"/>
				<updated>2024-05-28T20:43:07Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To run tests in a specific dir&lt;br /&gt;
  pytest path/to/dir&lt;br /&gt;
&lt;br /&gt;
To run tests in a specific file&lt;br /&gt;
  pytest path/to/test_file.py&lt;br /&gt;
&lt;br /&gt;
To run a specific test in a file&lt;br /&gt;
  pytest path/to/test_file.py::test_function&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  pytest path/to/test_file.py -k 'test_name'&lt;br /&gt;
&lt;br /&gt;
To show the print statements.&lt;br /&gt;
  -s or --capture=no&lt;br /&gt;
&lt;br /&gt;
To show log statements&lt;br /&gt;
  -o log_cli=true&lt;br /&gt;
&lt;br /&gt;
To set the log level.&lt;br /&gt;
  --log-cli-level=INFO&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1161</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pdb&amp;diff=1161"/>
				<updated>2024-05-28T20:42:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;To debug python applications use the library pdb.  Add the following to the top of your file.    import pdb   pdb.set_trace()  And then just add the following to your command....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To debug python applications use the library pdb.&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your file.&lt;br /&gt;
&lt;br /&gt;
  import pdb&lt;br /&gt;
  pdb.set_trace()&lt;br /&gt;
&lt;br /&gt;
And then just add the following to your command.&lt;br /&gt;
  --pdb&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  pytest --pdb test/test.py&lt;br /&gt;
&lt;br /&gt;
Once it starts up you will be brought to a promote.&lt;br /&gt;
From the there you can use any of the following.&lt;br /&gt;
&lt;br /&gt;
Navigating Code (within the Pdb interpreter)&lt;br /&gt;
  l(ist)   list 11 lines surrounding the current line&lt;br /&gt;
  w(here)  display the file and line number of the current line&lt;br /&gt;
  n(ext)   execute the current line&lt;br /&gt;
  s(tep)   step into functions called at the current line&lt;br /&gt;
  r(eturn) execute until the current function’s return is encountered&lt;br /&gt;
&lt;br /&gt;
Controlling Execution&lt;br /&gt;
  b[#]       create a breakpoint at line [#]&lt;br /&gt;
  b          list breakpoints and their indices&lt;br /&gt;
  c(ontinue) execute until a breakpoint is encountered&lt;br /&gt;
  clear[#]   clear breakpoint of index [#]&lt;br /&gt;
&lt;br /&gt;
Changing Variables / Interacting with Code&lt;br /&gt;
  p&amp;lt;name&amp;gt; print value of the variable &amp;lt;name&amp;gt;&lt;br /&gt;
  !&amp;lt;expr&amp;gt; execute the expression &amp;lt;expr&amp;gt; NOTE: this acts just like a python interpreter&lt;br /&gt;
  q(uit)  exit the debugger&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add a breakpoint in the python.&lt;br /&gt;
  breakpoint()&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python&amp;diff=1160</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python&amp;diff=1160"/>
				<updated>2024-05-28T16:23:02Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[python2|Python2]]&lt;br /&gt;
&lt;br /&gt;
[[python3|Python2]]&lt;br /&gt;
&lt;br /&gt;
[[python_ve|Virtual Environment]]&lt;br /&gt;
&lt;br /&gt;
[[python_requirements|Requirements]]&lt;br /&gt;
&lt;br /&gt;
[[python_pyenv|PyEnv]] - Manage python versions.&lt;br /&gt;
&lt;br /&gt;
[[python_pytest|PyTest]]&lt;br /&gt;
&lt;br /&gt;
[[python_pdb|Debug]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1159</id>
		<title>Kubectl</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1159"/>
				<updated>2024-05-17T16:03:00Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kubectl is an application that interacts with Kubernetes clusters.&lt;br /&gt;
&lt;br /&gt;
'''Check the context'''&lt;br /&gt;
&lt;br /&gt;
This checks who kubectl is connected to.&lt;br /&gt;
  kubectl config current-context&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apply a configuration yaml file.'''&lt;br /&gt;
  kubectl apply -f [name_of_file]&lt;br /&gt;
&lt;br /&gt;
'''Get the configuration yaml file.'''&lt;br /&gt;
  kubectl get pod [podname]  --namespace [namespace] -o yaml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploy ==&lt;br /&gt;
'''Get Deployments'''&lt;br /&gt;
  kubectl get deployments --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Delete Deployments'''&lt;br /&gt;
  kubectl delete deployment [name_of_deployment] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
'''Get Pods'''&lt;br /&gt;
&lt;br /&gt;
This gets all the pods.&lt;br /&gt;
  kubectl get pods --namespace cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete a pod&lt;br /&gt;
  kubectl delete pod [pod_name]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Remote in to a pod ==&lt;br /&gt;
This will allow you to execute a command which in the example below it will start up a shell.&lt;br /&gt;
  kubectl exec --stdin --tty [pod_name] --namespace [namespace] -- /bin/sh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
List Persistent Volumes Claims&lt;br /&gt;
  kubectl describe pvc --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
Get the logs from a pod.&lt;br /&gt;
  kubectl logs -p [pod_name] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
For any sidecars you may need to specifiy a container.&lt;br /&gt;
    kubectl logs -p [pod_name] --namespace=cs --container gce-proxy&lt;br /&gt;
&lt;br /&gt;
You can also follow the logs live with the following flaf.&lt;br /&gt;
  --follow&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
Get a list of events.&lt;br /&gt;
&lt;br /&gt;
  kubectl get events&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra commands to help.==&lt;br /&gt;
If you have to include a name space.&lt;br /&gt;
  --namespace scdf-jf&lt;br /&gt;
&lt;br /&gt;
To be past any SSL issues.&lt;br /&gt;
  --insecure-skip-tls-verify&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1158</id>
		<title>Kubectl</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1158"/>
				<updated>2024-05-17T16:00:36Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: /* Logs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kubectl is an application that interacts with Kubernetes clusters.&lt;br /&gt;
&lt;br /&gt;
'''Check the context'''&lt;br /&gt;
&lt;br /&gt;
This checks who kubectl is connected to.&lt;br /&gt;
  kubectl config current-context&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apply a configuration yaml file.'''&lt;br /&gt;
  kubectl apply -f [name_of_file]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploy ==&lt;br /&gt;
'''Get Deployments'''&lt;br /&gt;
  kubectl get deployments --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Delete Deployments'''&lt;br /&gt;
  kubectl delete deployment [name_of_deployment] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
'''Get Pods'''&lt;br /&gt;
&lt;br /&gt;
This gets all the pods.&lt;br /&gt;
  kubectl get pods --namespace cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete a pod&lt;br /&gt;
  kubectl delete pod [pod_name]&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
List Persistent Volumes Claims&lt;br /&gt;
  kubectl describe pvc --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
Get the logs from a pod.&lt;br /&gt;
  kubectl logs -p [pod_name] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
For any sidecars you may need to specifiy a container.&lt;br /&gt;
    kubectl logs -p [pod_name] --namespace=cs --container gce-proxy&lt;br /&gt;
&lt;br /&gt;
You can also follow the logs live with the following flaf.&lt;br /&gt;
  --follow&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
Get a list of events.&lt;br /&gt;
&lt;br /&gt;
  kubectl get events&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra commands to help.==&lt;br /&gt;
If you have to include a name space.&lt;br /&gt;
  --namespace scdf-jf&lt;br /&gt;
&lt;br /&gt;
To be past any SSL issues.&lt;br /&gt;
  --insecure-skip-tls-verify&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1157</id>
		<title>Kubectl</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Kubectl&amp;diff=1157"/>
				<updated>2024-05-17T15:55:16Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Kubectl is an application that interacts with Kubernetes clusters.&lt;br /&gt;
&lt;br /&gt;
'''Check the context'''&lt;br /&gt;
&lt;br /&gt;
This checks who kubectl is connected to.&lt;br /&gt;
  kubectl config current-context&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Apply a configuration yaml file.'''&lt;br /&gt;
  kubectl apply -f [name_of_file]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploy ==&lt;br /&gt;
'''Get Deployments'''&lt;br /&gt;
  kubectl get deployments --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Delete Deployments'''&lt;br /&gt;
  kubectl delete deployment [name_of_deployment] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
'''Get Pods'''&lt;br /&gt;
&lt;br /&gt;
This gets all the pods.&lt;br /&gt;
  kubectl get pods --namespace cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete a pod&lt;br /&gt;
  kubectl delete pod [pod_name]&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
List Persistent Volumes Claims&lt;br /&gt;
  kubectl describe pvc --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
Get the logs from a pod.&lt;br /&gt;
  kubectl logs -p [pod_name] --namespace=cs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
Get a list of events.&lt;br /&gt;
&lt;br /&gt;
  kubectl get events&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra commands to help.==&lt;br /&gt;
If you have to include a name space.&lt;br /&gt;
  --namespace scdf-jf&lt;br /&gt;
&lt;br /&gt;
To be past any SSL issues.&lt;br /&gt;
  --insecure-skip-tls-verify&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Python_pytest&amp;diff=1156</id>
		<title>Python pytest</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Python_pytest&amp;diff=1156"/>
				<updated>2024-05-08T23:35:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To run tests in a specific dir&lt;br /&gt;
  pytest path/to/dir&lt;br /&gt;
&lt;br /&gt;
To run tests in a specific file&lt;br /&gt;
  pytest path/to/test_file.py&lt;br /&gt;
&lt;br /&gt;
To run a specific test in a file&lt;br /&gt;
  pytest path/to/test_file.py::test_function&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  pytest path/to/test_file.py -k 'test_name'&lt;br /&gt;
&lt;br /&gt;
To show the print statements.&lt;br /&gt;
  -s or --capture=no&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1155</id>
		<title>VIM</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=VIM&amp;diff=1155"/>
				<updated>2024-04-17T15:52:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Syntax Highlighting==&lt;br /&gt;
Inside VI type the command below.&lt;br /&gt;
&lt;br /&gt;
 :syntax on&lt;br /&gt;
&lt;br /&gt;
Maybe&lt;br /&gt;
&lt;br /&gt;
 :syn on&lt;br /&gt;
&lt;br /&gt;
== Bottom Page ==&lt;br /&gt;
This goes to the bottom of the page.&lt;br /&gt;
 G&lt;br /&gt;
&lt;br /&gt;
== Bookmarks ==&lt;br /&gt;
To bookmark a position press m and then a letter.  Use capital letter for Global or multiple files.&lt;br /&gt;
  ma&lt;br /&gt;
&lt;br /&gt;
To go to the bookmark press ` and then letter marking you want to go to.&lt;br /&gt;
  `a&lt;br /&gt;
&lt;br /&gt;
To see all your bookmarks.&lt;br /&gt;
  :marks&lt;br /&gt;
&lt;br /&gt;
To to last edit location.&lt;br /&gt;
  `.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Record ==&lt;br /&gt;
To record a set of keys press q and then a letter to record to.&lt;br /&gt;
  qa&lt;br /&gt;
&lt;br /&gt;
To play back the recording press @ and then letter marking you want to play back.&lt;br /&gt;
  @a&lt;br /&gt;
&lt;br /&gt;
== Copy &amp;amp; Paste ==&lt;br /&gt;
To yank to a registered key&lt;br /&gt;
  &amp;quot; + {key} + y&lt;br /&gt;
&lt;br /&gt;
To paste from a registered key.&lt;br /&gt;
 &amp;quot; + {key} + p&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
'''Switch''' between windows.  The arrow key or direction key you want to go to.&lt;br /&gt;
  ctrl+w {arrow key} or {h,j,k,l}&lt;br /&gt;
&lt;br /&gt;
Opens a new vertical split&lt;br /&gt;
  CTRL+w, v&lt;br /&gt;
&lt;br /&gt;
Opens a new horizontal split&lt;br /&gt;
  CTRL+w, s&lt;br /&gt;
&lt;br /&gt;
Closes a window but keeps the buffer&lt;br /&gt;
  CTRL+w, c&lt;br /&gt;
&lt;br /&gt;
Closes other windows, keeps the active window only&lt;br /&gt;
  CTRL+w, o&lt;br /&gt;
&lt;br /&gt;
Moves the current window to the right&lt;br /&gt;
  CTRL+w, r&lt;br /&gt;
&lt;br /&gt;
Makes all splits equal size&lt;br /&gt;
  CTRL+w, =&lt;br /&gt;
&lt;br /&gt;
== Show Whitespace ==&lt;br /&gt;
&lt;br /&gt;
This will show all whitespace char&lt;br /&gt;
  set list&lt;br /&gt;
&lt;br /&gt;
You can also show only select char.&lt;br /&gt;
  :set listchars=eol:$,tab:&amp;gt;-,trail:~&lt;br /&gt;
&lt;br /&gt;
== Spelling ==&lt;br /&gt;
To turn spell checker on.&lt;br /&gt;
  :set spell spelllang=en_us&lt;br /&gt;
&lt;br /&gt;
To turn spell checker off.&lt;br /&gt;
  :set nospell&lt;br /&gt;
&lt;br /&gt;
To move between misspelled words.&lt;br /&gt;
  ]s and [s&lt;br /&gt;
&lt;br /&gt;
To get misspelled recommendations, move in misspelled word and press.&lt;br /&gt;
  z=&lt;br /&gt;
&lt;br /&gt;
To add word to dictionary.&lt;br /&gt;
  zg&lt;br /&gt;
&lt;br /&gt;
To mark a word as incorrect&lt;br /&gt;
  zw&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Autocomplete ==&lt;br /&gt;
This autocomplete tries to match word already in the document.&lt;br /&gt;
  ctl+n or ctl+p&lt;br /&gt;
&lt;br /&gt;
== Netrw ==&lt;br /&gt;
Open as a left window.&lt;br /&gt;
  :Lexplore or :Lex&lt;br /&gt;
&lt;br /&gt;
Open as a new tab.&lt;br /&gt;
  :tabe .&lt;br /&gt;
&lt;br /&gt;
Open file in new tab when in Netrw.&lt;br /&gt;
  t&lt;br /&gt;
&lt;br /&gt;
Create new file.&lt;br /&gt;
  %&lt;br /&gt;
&lt;br /&gt;
Create new directory.&lt;br /&gt;
  d&lt;br /&gt;
&lt;br /&gt;
Delete file or directory.&lt;br /&gt;
  D&lt;br /&gt;
&lt;br /&gt;
== Terminal ==&lt;br /&gt;
You can open a new terminal by typing.&lt;br /&gt;
  :terminal&lt;br /&gt;
&lt;br /&gt;
You can enter `normal` mode.&lt;br /&gt;
  ctrl-\ ctrl-n&lt;br /&gt;
&lt;br /&gt;
Exit terminal mode&lt;br /&gt;
  ctrl-d&lt;br /&gt;
&lt;br /&gt;
== Pipe in data from console ==&lt;br /&gt;
To pipe in data from the command line use the following&lt;br /&gt;
  :%!{command}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
If you in the terminal and want the output to go into vim.&lt;br /&gt;
  ls | vim -&lt;br /&gt;
&lt;br /&gt;
== Column Editing ==&lt;br /&gt;
Column editing is editing a bunch of lines at once.&lt;br /&gt;
&lt;br /&gt;
  ctrl-v - start highlight of columns.&lt;br /&gt;
  h,j,k,l - to select the columns and/or rows&lt;br /&gt;
  shift-i - to go to insert mode.&lt;br /&gt;
&lt;br /&gt;
== Highlight blocks ==&lt;br /&gt;
To quick highlight blocks of code with in { or [&lt;br /&gt;
&lt;br /&gt;
Move the curser inside the block, and type the following.&lt;br /&gt;
  vi[&lt;br /&gt;
or&lt;br /&gt;
  vi{&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Switch bash to use VIM ==&lt;br /&gt;
This will allow the terminal to use vim keys.&lt;br /&gt;
  set -o vi&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1154</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1154"/>
				<updated>2024-03-01T20:12:29Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Rebase ==&lt;br /&gt;
When you are on a branch, you get &lt;br /&gt;
  git rebase master&lt;br /&gt;
&lt;br /&gt;
You will get conflicts with the remote origin if you try and push. Here are some ways to solve this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will force the remote origin to stay up to date with your branch. But be aware, if there are more people working on the feature branch then just you, you may overwrite code.&lt;br /&gt;
  git push --force origin feature_branch&lt;br /&gt;
&lt;br /&gt;
With force with lease, git will warn you if anyone else has committed any code, this helps to prevent overwriting someones code.&lt;br /&gt;
  git push --force-with-lease&lt;br /&gt;
&lt;br /&gt;
Another good option after rebase with master is to just delete the branch on the remote origin, and then recreate it.&lt;br /&gt;
  git checkout myFeature&lt;br /&gt;
  git rebase master&lt;br /&gt;
  git push origin --delete myFeature&lt;br /&gt;
  git push origin myFeature&lt;br /&gt;
&lt;br /&gt;
== Squash feature branch ==&lt;br /&gt;
This squashes all the commits in to one.&lt;br /&gt;
  git merge --squash feature &lt;br /&gt;
&lt;br /&gt;
and then you need to commit the new squashed changes.&lt;br /&gt;
  get commit -m &amp;quot;squashed changes merged in.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Squash Commits ==&lt;br /&gt;
This squashes the last 3 commits.&lt;br /&gt;
  git reset --soft HEAD~3&lt;br /&gt;
  git commit -m 'new commit message'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the logs ==&lt;br /&gt;
A another way to view the logs.&lt;br /&gt;
  git log --oneline --decorate --graph --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add all untracked changes. ==&lt;br /&gt;
Here is a couple of commands to help with backing things up.&lt;br /&gt;
This will add all untracked changes for a file type.&lt;br /&gt;
  git ls-files --other | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
This will add all tracked changes for a file type.&lt;br /&gt;
  git ls-files | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sign with GPG&lt;br /&gt;
List your keys&lt;br /&gt;
  gpg --list-secret-keys --keyid-format=long&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update git to use a specific key.&lt;br /&gt;
  git config --global user.signingkey 3AA5C34371567BD2&lt;br /&gt;
&lt;br /&gt;
Sign all commits by default.&lt;br /&gt;
  git config --global commit.gpgsign true&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Osx-users&amp;diff=1153</id>
		<title>Osx-users</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Osx-users&amp;diff=1153"/>
				<updated>2024-02-29T16:20:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Add a user to a group   sudo dseditgroup -o edit -a john -t user agroup  Create a group   sudo dscl . create /Groups/dev  List items about a group.   dscacheutil -q group -a n...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add a user to a group&lt;br /&gt;
  sudo dseditgroup -o edit -a john -t user agroup&lt;br /&gt;
&lt;br /&gt;
Create a group&lt;br /&gt;
  sudo dscl . create /Groups/dev&lt;br /&gt;
&lt;br /&gt;
List items about a group.&lt;br /&gt;
  dscacheutil -q group -a name dev&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Osx&amp;diff=1152</id>
		<title>Osx</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Osx&amp;diff=1152"/>
				<updated>2024-02-29T16:19:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[osx-apache|Apache]]&lt;br /&gt;
&lt;br /&gt;
[[osx-maven|Maven]]&lt;br /&gt;
&lt;br /&gt;
[[osx-prefs|Preferences Fix]]&lt;br /&gt;
&lt;br /&gt;
[[osx-xattr|XAttr]]&lt;br /&gt;
&lt;br /&gt;
[[osx-access-issue|Access Issue]]&lt;br /&gt;
&lt;br /&gt;
[[osx-nginx|Nginx]]&lt;br /&gt;
&lt;br /&gt;
[[osx-users|Users and Groups]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1151</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Git&amp;diff=1151"/>
				<updated>2024-02-28T19:55:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Rebase ==&lt;br /&gt;
When you are on a branch, you get &lt;br /&gt;
  git rebase master&lt;br /&gt;
&lt;br /&gt;
You will get conflicts with the remote origin if you try and push. Here are some ways to solve this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will force the remote origin to stay up to date with your branch. But be aware, if there are more people working on the feature branch then just you, you may overwrite code.&lt;br /&gt;
  git push --force origin feature_branch&lt;br /&gt;
&lt;br /&gt;
With force with lease, git will warn you if anyone else has committed any code, this helps to prevent overwriting someones code.&lt;br /&gt;
  git push --force-with-lease&lt;br /&gt;
&lt;br /&gt;
Another good option after rebase with master is to just delete the branch on the remote origin, and then recreate it.&lt;br /&gt;
  git checkout myFeature&lt;br /&gt;
  git rebase master&lt;br /&gt;
  git push origin --delete myFeature&lt;br /&gt;
  git push origin myFeature&lt;br /&gt;
&lt;br /&gt;
== Squash feature branch ==&lt;br /&gt;
This squashes all the commits in to one.&lt;br /&gt;
  git merge --squash feature &lt;br /&gt;
&lt;br /&gt;
and then you need to commit the new squashed changes.&lt;br /&gt;
  get commit -m &amp;quot;squashed changes merged in.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Squash Commits ==&lt;br /&gt;
This squashes the last 3 commits.&lt;br /&gt;
  git reset --soft HEAD~3&lt;br /&gt;
  git commit -m 'new commit message'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the logs ==&lt;br /&gt;
A another way to view the logs.&lt;br /&gt;
  git log --oneline --decorate --graph --all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add all untracked changes. ==&lt;br /&gt;
Here is a couple of commands to help with backing things up.&lt;br /&gt;
This will add all untracked changes for a file type.&lt;br /&gt;
  git ls-files --other | grep &amp;quot;.md&amp;quot; | xargs git add&lt;br /&gt;
&lt;br /&gt;
This will add all tracked changes for a file type.&lt;br /&gt;
  git ls-files | grep &amp;quot;.md&amp;quot; | xargs git add&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Plsql_search_constraints&amp;diff=1150</id>
		<title>Plsql search constraints</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Plsql_search_constraints&amp;diff=1150"/>
				<updated>2023-10-03T16:33:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Run the query below to search for information on constraints.&lt;br /&gt;
&lt;br /&gt;
* OWNER = Schema&lt;br /&gt;
* FK_NAME = Constraint name&lt;br /&gt;
&lt;br /&gt;
 select * &lt;br /&gt;
 from all_constraints&lt;br /&gt;
 where 1=1&lt;br /&gt;
 --and owner = 'OWNER'&lt;br /&gt;
 and constraint_name LIKE '%FK_NAME%';&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Plsql_search_constraints&amp;diff=1149</id>
		<title>Plsql search constraints</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Plsql_search_constraints&amp;diff=1149"/>
				<updated>2023-10-03T16:30:42Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Run the query below to search for information on constraints.&lt;br /&gt;
&lt;br /&gt;
* OWNER = Schema&lt;br /&gt;
* FK_NAME = Constraint name&lt;br /&gt;
&lt;br /&gt;
 select * &lt;br /&gt;
 from all_constraints&lt;br /&gt;
 where 1=1&lt;br /&gt;
 --and owner = 'OWNER'&lt;br /&gt;
 and constraint_name LIKE '%FK_NAME%';&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way&lt;br /&gt;
  SELECT *&lt;br /&gt;
  FROM user_constraints&lt;br /&gt;
  WHERE table_name = '&amp;lt;your table name&amp;gt;'&lt;br /&gt;
    AND constraint_name = '&amp;lt;your constraint name&amp;gt;';&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Plsql_first_records&amp;diff=1148</id>
		<title>Plsql first records</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Plsql_first_records&amp;diff=1148"/>
				<updated>2023-10-03T16:28:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;To fetch the first 10 records from a result.    SELECT *   FROM table_a   FETCH FIRST 1 ROW ONLY;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To fetch the first 10 records from a result.&lt;br /&gt;
&lt;br /&gt;
  SELECT *&lt;br /&gt;
  FROM table_a&lt;br /&gt;
  FETCH FIRST 1 ROW ONLY;&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Plsql&amp;diff=1147</id>
		<title>Plsql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Plsql&amp;diff=1147"/>
				<updated>2023-10-03T16:27:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[plsql_variables|Variables]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_search_constraints|Search Constraints]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_search_tables|Search Tables]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_search_columns|Search Columns]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_dbms_output|Output to console]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_current_schema|Set Current Schema Session]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_date|Date Functions]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_loops|Loops]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_sequence|Sequence]]&lt;br /&gt;
&lt;br /&gt;
[[plsql_first_records|Fetch First Records]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1146</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1146"/>
				<updated>2023-08-03T21:05:10Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Keyboard Shortcuts ==&lt;br /&gt;
To send the current line to VIM for editing.&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== One line conditional ==&lt;br /&gt;
Both the following lines will write to the screen &amp;quot;false&amp;quot;&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 0 &amp;amp;#93;&amp;amp;#93; || echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 1 &amp;amp;#93;&amp;amp;#93; &amp;amp;&amp;amp; echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check for environment variable ==&lt;br /&gt;
This will check to see if an variable is set&lt;br /&gt;
  if &amp;amp;#91;&amp;amp;#91; -z &amp;quot;$var&amp;quot; &amp;amp;#93;&amp;amp;#93;; then&lt;br /&gt;
    echo &amp;quot;var is not set&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change the command prompt. ==&lt;br /&gt;
To change the command prompt, export the below value.&lt;br /&gt;
  export PS1=&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
  export PS1=&amp;quot;${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alias ==&lt;br /&gt;
To find the command associated with an alias.&lt;br /&gt;
  type [alias_name]&lt;br /&gt;
&lt;br /&gt;
To list all aliases, just type 'alias'.&lt;br /&gt;
  alias&lt;br /&gt;
&lt;br /&gt;
To create an alias.&lt;br /&gt;
  alias myproject='cd /Users/jfreier/Projects/my_project'&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Echo commands ==&lt;br /&gt;
This will print all commands that are ran.&lt;br /&gt;
  set -x&lt;br /&gt;
&lt;br /&gt;
== To set the CD Path ==&lt;br /&gt;
  $CDPATH&lt;br /&gt;
&lt;br /&gt;
== Alternative Screen ==&lt;br /&gt;
This happens when you run a command a new screen appears and then is closed when done.&lt;br /&gt;
&lt;br /&gt;
To turn this feature off.&lt;br /&gt;
  export LESS=&amp;quot;-FRX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This new screen is actually LESS and it just needs different flags.&lt;br /&gt;
&lt;br /&gt;
== Temporary Environment Variables for Scripts ==&lt;br /&gt;
If you have a script or command that uses environment variables, you can set one time variables be just prefixing the comment with the environment variable and command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
echo_env_var.sh&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
  echo $JOHN_FREIER&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  # JOHN_FREIER=1 ./echo_env_var.sh&lt;br /&gt;
&lt;br /&gt;
== Exit script on error ==&lt;br /&gt;
To immediately exit a script when an error happens use the following command.&lt;br /&gt;
  set -e&lt;br /&gt;
&lt;br /&gt;
== Loop through argument variables. ==&lt;br /&gt;
This sniplet will loop through the arguments of a script.&lt;br /&gt;
&lt;br /&gt;
  for var in &amp;quot;$@&amp;quot;&lt;br /&gt;
  do&lt;br /&gt;
  	echo &amp;quot;arg: $var&amp;quot;&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
== Previous command arguments ==&lt;br /&gt;
To the the arguments from the previous command.&lt;br /&gt;
&lt;br /&gt;
  !^      first argument&lt;br /&gt;
  !$      last argument&lt;br /&gt;
  !*      all arguments&lt;br /&gt;
  !:2     second argument&lt;br /&gt;
  &lt;br /&gt;
  !:2-3   second to third arguments&lt;br /&gt;
  !:2-$   second to last arguments&lt;br /&gt;
  !:2*    second to last arguments&lt;br /&gt;
  !:2-    second to next to last arguments&lt;br /&gt;
  &lt;br /&gt;
  !:0     the command&lt;br /&gt;
  !!      repeat the previous line, good with sudo&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1145</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1145"/>
				<updated>2023-07-21T16:25:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Database Connection ==&lt;br /&gt;
This is a way to test the database connection.&lt;br /&gt;
  ./pg_isready -h localhost -p 5432&lt;br /&gt;
&lt;br /&gt;
== Application Structure ==&lt;br /&gt;
Log location&lt;br /&gt;
 ./data/log/&lt;br /&gt;
&lt;br /&gt;
== OSX ==&lt;br /&gt;
The Postgres app live here on OSX&lt;br /&gt;
  /Library/PostgreSQL/11&lt;br /&gt;
&lt;br /&gt;
Start&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data start&lt;br /&gt;
&lt;br /&gt;
Stop&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
FYI, haven't tried but look like a nicer app to control Postgres is https://postgresapp.com.&lt;br /&gt;
&lt;br /&gt;
If you are not using the system registered database you can all simply use the following commands.&lt;br /&gt;
&lt;br /&gt;
  pg_ctl -D ./data start&lt;br /&gt;
  pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
== Initialize a database directory ==&lt;br /&gt;
To initialize a database directory use the following command.&lt;br /&gt;
&lt;br /&gt;
  initdb -D &amp;lt;data_directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Environment Path ==&lt;br /&gt;
To add PostgreSQL in to your environment path.&lt;br /&gt;
&lt;br /&gt;
  export POSTGRESQL_HOME=/Library/PostgreSQL/11&lt;br /&gt;
  PATH=$PATH:$POSTGRESQL_HOME/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
You can start Postgres in Debian using&lt;br /&gt;
  /etc/init.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
Create a database and user&lt;br /&gt;
  sudo su - postgres&lt;br /&gt;
  createdb testdb&lt;br /&gt;
  createuser testdb&lt;br /&gt;
&lt;br /&gt;
To create a password for the user either use&lt;br /&gt;
  createuser testdb --pwprompt&lt;br /&gt;
or&lt;br /&gt;
  psql&lt;br /&gt;
  ALTER USER 'testdb' WITH PASSWORD 'testdb';&lt;br /&gt;
&lt;br /&gt;
To have the new user be a superuser add the following.&lt;br /&gt;
  createuser --superuser testdb --pwprompt&lt;br /&gt;
&lt;br /&gt;
== Run file and commands from CLI ==&lt;br /&gt;
PSQL will ask for your password every time unless you set it as an environment variable.&lt;br /&gt;
  export PGPASSWORD=Password123&lt;br /&gt;
&lt;br /&gt;
To run a command.&lt;br /&gt;
  psql -U user_name -d database_name -c &amp;quot;SELECT * FROM tblExample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To run a file.&lt;br /&gt;
  psql -U user_name -d database_name -f ./file.sql&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
Error Connecting to database FATAL : no pg_hba.conf entry for host&lt;br /&gt;
I had to add the host ip address into the pg_hba.conf file.&lt;br /&gt;
&lt;br /&gt;
location of file: ./data/pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Added the following line and then restarted Postgres.&lt;br /&gt;
  host    all             all             10.225.41.95/24        md5&lt;br /&gt;
&lt;br /&gt;
== Describe a table ==&lt;br /&gt;
You can query the 'information_schema.columns' table to find internal table information.&lt;br /&gt;
&lt;br /&gt;
This is a sample command to find information about a table.&lt;br /&gt;
  SELECT table_name, column_name, data_type&lt;br /&gt;
  FROM information_schema.columns&lt;br /&gt;
  WHERE table_name='TABLE_A';&lt;br /&gt;
&lt;br /&gt;
== Top 10 rows ==&lt;br /&gt;
This is to get the top 10 rows.&lt;br /&gt;
  select *&lt;br /&gt;
  from table_a&lt;br /&gt;
  fetch first 10 rows only;&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1144</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Podman&amp;diff=1144"/>
				<updated>2023-07-12T20:00:07Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Podman ==&lt;br /&gt;
&lt;br /&gt;
'''Start Podman'''&lt;br /&gt;
  podman machine start&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
'''List Images'''&lt;br /&gt;
  podman images&lt;br /&gt;
&lt;br /&gt;
'''Pull an image'''&lt;br /&gt;
  podman pull docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
'''Run an image'''&lt;br /&gt;
  podman run -dt -p 8080:80/tcp docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it --entrypoint=&amp;quot;/bin/sh&amp;quot; docker.io/library/httpd&lt;br /&gt;
  &lt;br /&gt;
  podman run -it -v /home/user/project:/app --entrypoint=&amp;quot;/bin/bash&amp;quot; python:3.9.13-buster&lt;br /&gt;
&lt;br /&gt;
* The -d will run the container in detach mode, so you wont see any console.&lt;br /&gt;
* The -t command connects the container to your terminal so it will not exit after it runs.&lt;br /&gt;
&lt;br /&gt;
The following command with -rm will clean up the container and remove any persists data.&lt;br /&gt;
  podman run -rm docker.io/library/httpd&lt;br /&gt;
&lt;br /&gt;
To commit a container to the list of podman images.&lt;br /&gt;
  podman commit {id}&lt;br /&gt;
&lt;br /&gt;
'''Continue a container'''&lt;br /&gt;
This will start back up an exited container, it will continue where you left off.&lt;br /&gt;
  podman start {id}&lt;br /&gt;
&lt;br /&gt;
'''Get in to a running container'''&lt;br /&gt;
   podman exec -it {id} /bin/sh&lt;br /&gt;
&lt;br /&gt;
'''List running images'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Image'''&lt;br /&gt;
  podman rmi {image_sha}&lt;br /&gt;
&lt;br /&gt;
'''Load an Image'''&lt;br /&gt;
  Worked&lt;br /&gt;
  cat cs-oci.tar | podman load&lt;br /&gt;
  &lt;br /&gt;
  Did not work.&lt;br /&gt;
  podman load oci-archive:cs-oci.tar:latest&lt;br /&gt;
&lt;br /&gt;
'''Update the tag for an image'''&lt;br /&gt;
  podman tag e7b8dd57dec6 cs:latest&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
'''List all containers'''&lt;br /&gt;
  podman ps -a&lt;br /&gt;
&lt;br /&gt;
'''Remove Container'''&lt;br /&gt;
  podman rm ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
== Pods ==&lt;br /&gt;
&lt;br /&gt;
'''Create a pod'''&lt;br /&gt;
  podman pod create --name mypod&lt;br /&gt;
&lt;br /&gt;
'''List pods'''&lt;br /&gt;
  podman pod list&lt;br /&gt;
&lt;br /&gt;
'''Start pod'''&lt;br /&gt;
  podman pod start {podname}&lt;br /&gt;
&lt;br /&gt;
'''Stop pod'''&lt;br /&gt;
  podman pod stop {podname}&lt;br /&gt;
&lt;br /&gt;
'''List all processes with pods'''&lt;br /&gt;
  podman ps -a --pod&lt;br /&gt;
&lt;br /&gt;
== Volume ==&lt;br /&gt;
&lt;br /&gt;
Volume in Podman can be a virtual volume that is mounted through Podman.  This virtual volume can be exported or imported as well.&lt;br /&gt;
&lt;br /&gt;
You can also setup to point to a local host directory but because Podman is rootless Podman will need access to the directory, by either permissions on the directory or the user that runs the container from Podman.&lt;br /&gt;
&lt;br /&gt;
'''Create Virtual Volume'''&lt;br /&gt;
  podman volume create myvolume&lt;br /&gt;
&lt;br /&gt;
'''Export Virtual Volume'''&lt;br /&gt;
  podman volume export myvolume --output myvolume.tar&lt;br /&gt;
&lt;br /&gt;
== Repositories ==&lt;br /&gt;
To login to a repository.&lt;br /&gt;
The below example is for harbor but could be used for others.&lt;br /&gt;
  podman login --username JDOE --password {cli_secret}  https://registry.harbor-url.com/&lt;br /&gt;
&lt;br /&gt;
== Build ==&lt;br /&gt;
&lt;br /&gt;
To build and avoid any cached layers use the following.&lt;br /&gt;
  podman build --no-cache -t $container_name:$container_tag .&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
&lt;br /&gt;
'''View Logs'''&lt;br /&gt;
  podman logs ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
'''Stop the latest container'''&lt;br /&gt;
&lt;br /&gt;
  podman stop ff22b3bfecc1&lt;br /&gt;
&lt;br /&gt;
== Kube ==&lt;br /&gt;
&lt;br /&gt;
'''Generate kubernetes yaml'''&lt;br /&gt;
  podman generate kube -f infra.yaml mypod&lt;br /&gt;
&lt;br /&gt;
'''Load kubernetes yaml'''&lt;br /&gt;
  podman play kube infra.yaml&lt;br /&gt;
&lt;br /&gt;
'''Kubernetes File'''&lt;br /&gt;
# Kubernetes setup for CS.&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: ConfigMap&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: cs-config&lt;br /&gt;
  data:&lt;br /&gt;
    CS_DATABASE_MONGODB_EMBEDED_ENABLED: &amp;quot;false&amp;quot;&lt;br /&gt;
    SPRING_DATA_MONGODB_HOST: &amp;quot;localhost&amp;quot;&lt;br /&gt;
  ---&lt;br /&gt;
  apiVersion: v1&lt;br /&gt;
  kind: Pod&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: mypod&lt;br /&gt;
    labels:&lt;br /&gt;
      app: mypod&lt;br /&gt;
  spec:&lt;br /&gt;
    containers:&lt;br /&gt;
      - name: database&lt;br /&gt;
        image: docker.io/library/mongo:4.4.13&lt;br /&gt;
        securityContext:&lt;br /&gt;
          runAsUser: 0&lt;br /&gt;
        volumeMounts:&lt;br /&gt;
          - name: mongodb-data-volume&lt;br /&gt;
            mountPath: /data/db&lt;br /&gt;
      - name: application&lt;br /&gt;
        image: cs:latest&lt;br /&gt;
        ports:&lt;br /&gt;
          - containerPort: 8080&lt;br /&gt;
            hostPort: 8080&lt;br /&gt;
        envFrom:&lt;br /&gt;
          - configMapRef:&lt;br /&gt;
             name: cs-config&lt;br /&gt;
    volumes:&lt;br /&gt;
      - name: mongodb-data-volume&lt;br /&gt;
        persistentVolumeClaim:&lt;br /&gt;
          claimName: mongodb-data-storage&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example run MongoDB'''&lt;br /&gt;
  podman run \ &lt;br /&gt;
    --detach \ &lt;br /&gt;
    --publish 27017:27017 \&lt;br /&gt;
    --userns=keep-id \ &lt;br /&gt;
    --volume ./mongo-data:/data/db \ &lt;br /&gt;
    --name some-mongo \ &lt;br /&gt;
    mongo:4.4.13 &lt;br /&gt;
  &lt;br /&gt;
  # --detach, -d - Detached mode: run the container in the background and print the new container ID. The default is false&lt;br /&gt;
  # --publish, -p - Publish a container’s port, or range of ports, to the host.&lt;br /&gt;
  # --userns - Because podman runs rootless we need to assign a user that can access the local volumn.  This sets the podman user to the same user who ran the podman command.&lt;br /&gt;
  # --volume, -v - Create a bind mount.&lt;br /&gt;
  # --name - Assign a name to the container.&lt;br /&gt;
&lt;br /&gt;
'''Example running with pods'''&lt;br /&gt;
This is a test to see how apps can talk between each other in a podman network within a pod.&lt;br /&gt;
&lt;br /&gt;
Create the pod&lt;br /&gt;
  podman pod create --userns=keep-id --publish 8080:8080 --name mypod&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --volume ./mongo-data:/data/db --pod mypod --name some-mongo mongo:4.4.13&lt;br /&gt;
&lt;br /&gt;
  podman run --detach --pod mypod --name myapp -e SPRING_DATA_MONGODB_HOST=&amp;quot;localhost&amp;quot; -e CS_DATABASE_MONGODB_EMBEDED_ENABLED=&amp;quot;false&amp;quot; e7b8dd57dec6&lt;br /&gt;
&lt;br /&gt;
  Not used - only for debug&lt;br /&gt;
  podman run -it --pod mypod --name myapp --volume ./config:/config --entrypoint &amp;quot;/bin/sh&amp;quot; e7b8dd57dec6&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1143</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1143"/>
				<updated>2023-07-07T20:25:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Database Connection ==&lt;br /&gt;
This is a way to test the database connection.&lt;br /&gt;
  ./pg_isready -h localhost -p 5432&lt;br /&gt;
&lt;br /&gt;
== Application Structure ==&lt;br /&gt;
Log location&lt;br /&gt;
 ./data/log/&lt;br /&gt;
&lt;br /&gt;
== OSX ==&lt;br /&gt;
The Postgres app live here on OSX&lt;br /&gt;
  /Library/PostgreSQL/11&lt;br /&gt;
&lt;br /&gt;
Start&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data start&lt;br /&gt;
&lt;br /&gt;
Stop&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
FYI, haven't tried but look like a nicer app to control Postgres is https://postgresapp.com.&lt;br /&gt;
&lt;br /&gt;
If you are not using the system registered database you can all simply use the following commands.&lt;br /&gt;
&lt;br /&gt;
  pg_ctl -D ./data start&lt;br /&gt;
  pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
== Initialize a database directory ==&lt;br /&gt;
To initialize a database directory use the following command.&lt;br /&gt;
&lt;br /&gt;
  initdb -D &amp;lt;data_directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Environment Path ==&lt;br /&gt;
To add PostgreSQL in to your environment path.&lt;br /&gt;
&lt;br /&gt;
  export POSTGRESQL_HOME=/Library/PostgreSQL/11&lt;br /&gt;
  PATH=$PATH:$POSTGRESQL_HOME/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
You can start Postgres in Debian using&lt;br /&gt;
  /etc/init.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
Create a database and user&lt;br /&gt;
  sudo su - postgres&lt;br /&gt;
  createdb testdb&lt;br /&gt;
  createuser testdb&lt;br /&gt;
&lt;br /&gt;
To create a password for the user either use&lt;br /&gt;
  createuser testdb --pwprompt&lt;br /&gt;
or&lt;br /&gt;
  psql&lt;br /&gt;
  ALTER USER 'testdb' WITH PASSWORD 'testdb';&lt;br /&gt;
&lt;br /&gt;
To have the new user be a superuser add the following.&lt;br /&gt;
  createuser --superuser testdb --pwprompt&lt;br /&gt;
&lt;br /&gt;
== Run file and commands from CLI ==&lt;br /&gt;
PSQL will ask for your password every time unless you set it as an environment variable.&lt;br /&gt;
  export PGPASSWORD=Password123&lt;br /&gt;
&lt;br /&gt;
To run a command.&lt;br /&gt;
  psql -U user_name -d database_name -c &amp;quot;SELECT * FROM tblExample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To run a file.&lt;br /&gt;
  psql -U user_name -d database_name -f ./file.sql&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
Error Connecting to database FATAL : no pg_hba.conf entry for host&lt;br /&gt;
I had to add the host ip address into the pg_hba.conf file.&lt;br /&gt;
&lt;br /&gt;
location of file: ./data/pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Added the following line and then restarted Postgres.&lt;br /&gt;
  host    all             all             10.225.41.95/24        md5&lt;br /&gt;
&lt;br /&gt;
== Describe a table ==&lt;br /&gt;
You can query the 'information_schema.columns' table to find internal table information.&lt;br /&gt;
&lt;br /&gt;
This is a sample command to find information about a table.&lt;br /&gt;
  SELECT table_name, column_name, data_type&lt;br /&gt;
  FROM information_schema.columns&lt;br /&gt;
  WHERE table_name='TABLE_A';&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1142</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Postgresql&amp;diff=1142"/>
				<updated>2023-07-07T15:46:54Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Test Database Connection ==&lt;br /&gt;
This is a way to test the database connection.&lt;br /&gt;
  ./pg_isready -h localhost -p 5432&lt;br /&gt;
&lt;br /&gt;
== Application Structure ==&lt;br /&gt;
Log location&lt;br /&gt;
 ./data/log/&lt;br /&gt;
&lt;br /&gt;
== OSX ==&lt;br /&gt;
The Postgres app live here on OSX&lt;br /&gt;
  /Library/PostgreSQL/11&lt;br /&gt;
&lt;br /&gt;
Start&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data start&lt;br /&gt;
&lt;br /&gt;
Stop&lt;br /&gt;
  sudo -u postgres ./bin/pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
FYI, haven't tried but look like a nicer app to control Postgres is https://postgresapp.com.&lt;br /&gt;
&lt;br /&gt;
If you are not using the system registered database you can all simply use the following commands.&lt;br /&gt;
&lt;br /&gt;
  pg_ctl -D ./data start&lt;br /&gt;
  pg_ctl -D ./data stop&lt;br /&gt;
&lt;br /&gt;
== Initialize a database directory ==&lt;br /&gt;
To initialize a database directory use the following command.&lt;br /&gt;
&lt;br /&gt;
  initdb -D &amp;lt;data_directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Environment Path ==&lt;br /&gt;
To add PostgreSQL in to your environment path.&lt;br /&gt;
&lt;br /&gt;
  export POSTGRESQL_HOME=/Library/PostgreSQL/11&lt;br /&gt;
  PATH=$PATH:$POSTGRESQL_HOME/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
You can start Postgres in Debian using&lt;br /&gt;
  /etc/init.d/postgresql start&lt;br /&gt;
&lt;br /&gt;
Create a database and user&lt;br /&gt;
  sudo su - postgres&lt;br /&gt;
  createdb testdb&lt;br /&gt;
  createuser testdb&lt;br /&gt;
&lt;br /&gt;
To create a password for the user either use&lt;br /&gt;
  createuser testdb --pwprompt&lt;br /&gt;
or&lt;br /&gt;
  psql&lt;br /&gt;
  ALTER USER 'testdb' WITH PASSWORD 'testdb';&lt;br /&gt;
&lt;br /&gt;
To have the new user be a superuser add the following.&lt;br /&gt;
  createuser --superuser testdb --pwprompt&lt;br /&gt;
&lt;br /&gt;
== Run file and commands from CLI ==&lt;br /&gt;
PSQL will ask for your password every time unless you set it as an environment variable.&lt;br /&gt;
  export PGPASSWORD=Password123&lt;br /&gt;
&lt;br /&gt;
To run a command.&lt;br /&gt;
  psql -U user_name -d database_name -c &amp;quot;SELECT * FROM tblExample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To run a file.&lt;br /&gt;
  psql -U user_name -d database_name -f ./file.sql&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
&lt;br /&gt;
Error Connecting to database FATAL : no pg_hba.conf entry for host&lt;br /&gt;
I had to add the host ip address into the pg_hba.conf file.&lt;br /&gt;
&lt;br /&gt;
location of file: ./data/pg_hba.conf&lt;br /&gt;
&lt;br /&gt;
Added the following line and then restarted Postgres.&lt;br /&gt;
  host    all             all             10.225.41.95/24        md5&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1141</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1141"/>
				<updated>2023-06-26T18:40:59Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Keyboard Shortcuts ==&lt;br /&gt;
To send the current line to VIM for editing.&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== One line conditional ==&lt;br /&gt;
Both the following lines will write to the screen &amp;quot;false&amp;quot;&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 0 &amp;amp;#93;&amp;amp;#93; || echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 1 &amp;amp;#93;&amp;amp;#93; &amp;amp;&amp;amp; echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check for environment variable ==&lt;br /&gt;
This will check to see if an variable is set&lt;br /&gt;
  if &amp;amp;#91;&amp;amp;#91; -z &amp;quot;$var&amp;quot; &amp;amp;#93;&amp;amp;#93;; then&lt;br /&gt;
    echo &amp;quot;var is not set&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change the command prompt. ==&lt;br /&gt;
To change the command prompt, export the below value.&lt;br /&gt;
  export PS1=&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
  export PS1=&amp;quot;${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alias ==&lt;br /&gt;
To find the command associated with an alias.&lt;br /&gt;
  type [alias_name]&lt;br /&gt;
&lt;br /&gt;
To list all aliases, just type 'alias'.&lt;br /&gt;
  alias&lt;br /&gt;
&lt;br /&gt;
To create an alias.&lt;br /&gt;
  alias myproject='cd /Users/jfreier/Projects/my_project'&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Echo commands ==&lt;br /&gt;
This will print all commands that are ran.&lt;br /&gt;
  set -x&lt;br /&gt;
&lt;br /&gt;
== To set the CD Path ==&lt;br /&gt;
  $CDPATH&lt;br /&gt;
&lt;br /&gt;
== Alternative Screen ==&lt;br /&gt;
This happens when you run a command a new screen appears and then is closed when done.&lt;br /&gt;
&lt;br /&gt;
To turn this feature off.&lt;br /&gt;
  export LESS=&amp;quot;-FRX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This new screen is actually LESS and it just needs different flags.&lt;br /&gt;
&lt;br /&gt;
== Temporary Environment Variables for Scripts ==&lt;br /&gt;
If you have a script or command that uses environment variables, you can set one time variables be just prefixing the comment with the environment variable and command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
echo_env_var.sh&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
  echo $JOHN_FREIER&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  # JOHN_FREIER=1 ./echo_env_var.sh&lt;br /&gt;
&lt;br /&gt;
== Exit script on error ==&lt;br /&gt;
To immediately exit a script when an error happens use the following command.&lt;br /&gt;
  set -e&lt;br /&gt;
&lt;br /&gt;
== Loop through argument variables. ==&lt;br /&gt;
This sniplet will loop through the arguments of a script.&lt;br /&gt;
&lt;br /&gt;
  for var in &amp;quot;$@&amp;quot;&lt;br /&gt;
  do&lt;br /&gt;
  	echo &amp;quot;arg: $var&amp;quot;&lt;br /&gt;
  done&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1140</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1140"/>
				<updated>2023-06-26T18:39:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Keyboard Shortcuts ==&lt;br /&gt;
To send the current line to VIM for editing.&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== One line conditional ==&lt;br /&gt;
Both the following lines will write to the screen &amp;quot;false&amp;quot;&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 0 &amp;amp;#93;&amp;amp;#93; || echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 1 &amp;amp;#93;&amp;amp;#93; &amp;amp;&amp;amp; echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check for environment variable ==&lt;br /&gt;
This will check to see if an variable is set&lt;br /&gt;
  if &amp;amp;#91;&amp;amp;#91; -z &amp;quot;$var&amp;quot; &amp;amp;#93;&amp;amp;#93;; then&lt;br /&gt;
    echo &amp;quot;var is not set&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change the command prompt. ==&lt;br /&gt;
To change the command prompt, export the below value.&lt;br /&gt;
  export PS1=&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
  export PS1=&amp;quot;${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alias ==&lt;br /&gt;
To find the command associated with an alias.&lt;br /&gt;
  type [alias_name]&lt;br /&gt;
&lt;br /&gt;
To list all aliases, just type 'alias'.&lt;br /&gt;
  alias&lt;br /&gt;
&lt;br /&gt;
To create an alias.&lt;br /&gt;
  alias myproject='cd /Users/jfreier/Projects/my_project'&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Echo commands ==&lt;br /&gt;
This will print all commands that are ran.&lt;br /&gt;
  set -x&lt;br /&gt;
&lt;br /&gt;
== To set the CD Path ==&lt;br /&gt;
  $CDPATH&lt;br /&gt;
&lt;br /&gt;
== Alternative Screen ==&lt;br /&gt;
This happens when you run a command a new screen appears and then is closed when done.&lt;br /&gt;
&lt;br /&gt;
To turn this feature off.&lt;br /&gt;
  export LESS=&amp;quot;-FRX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This new screen is actually LESS and it just needs different flags.&lt;br /&gt;
&lt;br /&gt;
== Temporary Environment Variables for Scripts ==&lt;br /&gt;
If you have a script or command that uses environment variables, you can set one time variables be just prefixing the comment with the environment variable and command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
echo_env_var.sh&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
  echo $JOHN_FREIER&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  # JOHN_FREIER=1 ./echo_env_var.sh&lt;br /&gt;
&lt;br /&gt;
== Exit script on error ==&lt;br /&gt;
To immediately exit a script when an error happens use the following command.&lt;br /&gt;
  set -e&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Linux_gpg&amp;diff=1139</id>
		<title>Linux gpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Linux_gpg&amp;diff=1139"/>
				<updated>2023-06-26T17:31:58Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Import Public/Private Key ==&lt;br /&gt;
It doesn't make a difference if its a private key or public key, this is the correct way to import a key.&lt;br /&gt;
  gpg --import file.gpg&lt;br /&gt;
&lt;br /&gt;
== Export Public Key ==&lt;br /&gt;
&lt;br /&gt;
This is the command to export your public key, using the armor command will convert the key from binary to ascii, so you can email it or post it.&lt;br /&gt;
&lt;br /&gt;
  gpg --armor --export you@example.com &amp;gt; mykey.asc&lt;br /&gt;
&lt;br /&gt;
Another way&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_pub.gpg --armor --export me@email.com&lt;br /&gt;
&lt;br /&gt;
If you have more then one key another way where ABAACA is the hash.&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_pub.gpg --armor --export ABAACA&lt;br /&gt;
&lt;br /&gt;
Export a base64 output of your public key.&lt;br /&gt;
  gpg --export me@email.com | base64&lt;br /&gt;
&lt;br /&gt;
== Export Private Key ==&lt;br /&gt;
To export your private key.&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_sec.gpg --armor --export-secret-key me@email.com&lt;br /&gt;
&lt;br /&gt;
another way, where ABAACA is the hash&lt;br /&gt;
&lt;br /&gt;
  gpg --output mykey_sec.gpg --armor --export-secret-key ABAACA&lt;br /&gt;
&lt;br /&gt;
Base64 export of your private key.&lt;br /&gt;
   gpg --export-secret-key me@email.com | base64&lt;br /&gt;
&lt;br /&gt;
== List Keys ==&lt;br /&gt;
To see a list of all the keys in the system.&lt;br /&gt;
&lt;br /&gt;
  gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
== Sign a file ==&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig that will contain both the file and the signature. &lt;br /&gt;
  gpg --clear-sig --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig that contains an ascii file with just the signature.&lt;br /&gt;
  gpg --detach-sign --armor --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create a single file called text.sig with a binary signature.&lt;br /&gt;
  gpg --detach-sign --output text.sig text.txt&lt;br /&gt;
&lt;br /&gt;
This will create an binary file with a signature and original document.&lt;br /&gt;
  gpg --sign --output text.txt.sig text.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Backup ==&lt;br /&gt;
I read somewhere to back up the GPG file system, you can just copy ~/. gnupg but I have not tried this before.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
https://www.debuntu.org/how-to-importexport-gpg-key-pair/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Encrypt a File with Password ==&lt;br /&gt;
To encrypt a file with a password with gpg use the following&lt;br /&gt;
  gpg -c filename&lt;br /&gt;
&lt;br /&gt;
This will create a new encrypted file with the extension .gpg, you can delete the unencrypted file.&lt;br /&gt;
&lt;br /&gt;
To decrypt the file.&lt;br /&gt;
  gpg -d filename&lt;br /&gt;
&lt;br /&gt;
== Extend the expiration date of a key ==&lt;br /&gt;
If you key expires you can extend the expiration date of the key&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  gpg --quick-set-expire {key_id} {extended_amount}&lt;br /&gt;
&lt;br /&gt;
key_id=the key id&lt;br /&gt;
extended_amount=The amount of time to add, d, m, y&lt;br /&gt;
&lt;br /&gt;
example&lt;br /&gt;
  gpg --quick-set-expire 38D3CD66D0671E54B78001B43FD6190BCDE08D11 2y&lt;br /&gt;
&lt;br /&gt;
https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1138</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php?title=Bash&amp;diff=1138"/>
				<updated>2023-06-26T17:24:22Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Keyboard Shortcuts ==&lt;br /&gt;
To send the current line to VIM for editing.&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== One line conditional ==&lt;br /&gt;
Both the following lines will write to the screen &amp;quot;false&amp;quot;&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 0 &amp;amp;#93;&amp;amp;#93; || echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;amp;#91;&amp;amp;#91; 1 == 1 &amp;amp;#93;&amp;amp;#93; &amp;amp;&amp;amp; echo &amp;quot;text&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check for environment variable ==&lt;br /&gt;
This will check to see if an variable is set&lt;br /&gt;
  if &amp;amp;#91;&amp;amp;#91; -z &amp;quot;$var&amp;quot; &amp;amp;#93;&amp;amp;#93;; then&lt;br /&gt;
    echo &amp;quot;var is not set&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Change the command prompt. ==&lt;br /&gt;
To change the command prompt, export the below value.&lt;br /&gt;
  export PS1=&amp;quot;&amp;gt;&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
  export PS1=&amp;quot;${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Alias ==&lt;br /&gt;
To find the command associated with an alias.&lt;br /&gt;
  type [alias_name]&lt;br /&gt;
&lt;br /&gt;
To list all aliases, just type 'alias'.&lt;br /&gt;
  alias&lt;br /&gt;
&lt;br /&gt;
To create an alias.&lt;br /&gt;
  alias myproject='cd /Users/jfreier/Projects/my_project'&lt;br /&gt;
&lt;br /&gt;
== Edit in VIM ==&lt;br /&gt;
To bring a command line in to VIM for editing&lt;br /&gt;
  ctrl+x ctrl+e&lt;br /&gt;
&lt;br /&gt;
== Echo commands ==&lt;br /&gt;
This will print all commands that are ran.&lt;br /&gt;
  set -x&lt;br /&gt;
&lt;br /&gt;
== To set the CD Path ==&lt;br /&gt;
  $CDPATH&lt;br /&gt;
&lt;br /&gt;
== Alternative Screen ==&lt;br /&gt;
This happens when you run a command a new screen appears and then is closed when done.&lt;br /&gt;
&lt;br /&gt;
To turn this feature off.&lt;br /&gt;
  export LESS=&amp;quot;-FRX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This new screen is actually LESS and it just needs different flags.&lt;br /&gt;
&lt;br /&gt;
== Temporary Environment Variables for Scripts ==&lt;br /&gt;
If you have a script or command that uses environment variables, you can set one time variables be just prefixing the comment with the environment variable and command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
echo_env_var.sh&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  &lt;br /&gt;
  echo $JOHN_FREIER&lt;br /&gt;
&lt;br /&gt;
Command&lt;br /&gt;
  # JOHN_FREIER=1 ./echo_env_var.sh&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	</feed>