<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.johnfreier.com/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages</id>
		<title>John Freier - New pages [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.johnfreier.com/index.php?feed=atom&amp;namespace=0&amp;title=Special%3ANewPages"/>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Special:NewPages"/>
		<updated>2026-05-20T10:46:13Z</updated>
		<subtitle>From John Freier</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Pickling</id>
		<title>Pickling</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Pickling"/>
				<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/Coleslaw</id>
		<title>Coleslaw</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Coleslaw"/>
				<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/Python_poetry</id>
		<title>Python poetry</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_poetry"/>
				<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/Python_pdb</id>
		<title>Python pdb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_pdb"/>
				<updated>2024-05-28T20:42:11Z</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/Osx-users</id>
		<title>Osx-users</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Osx-users"/>
				<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/Plsql_first_records</id>
		<title>Plsql first records</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Plsql_first_records"/>
				<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/Python_pytest</id>
		<title>Python pytest</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_pytest"/>
				<updated>2023-05-02T18:49:53Z</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/Python_pyenv</id>
		<title>Python pyenv</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_pyenv"/>
				<updated>2023-01-19T21:26:31Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;PyEnv is a small app that helps manage different python versions in the system.  https://github.com/pyenv/pyenv  == Install a Python version == To list all the available versi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PyEnv is a small app that helps manage different python versions in the system.&lt;br /&gt;
&lt;br /&gt;
https://github.com/pyenv/pyenv&lt;br /&gt;
&lt;br /&gt;
== Install a Python version ==&lt;br /&gt;
To list all the available versions.&lt;br /&gt;
  pyenv install --list&lt;br /&gt;
&lt;br /&gt;
To install a version&lt;br /&gt;
  pyenv install 3.9.14&lt;br /&gt;
&lt;br /&gt;
== Install location ==&lt;br /&gt;
&lt;br /&gt;
Where are the versions of python installed.&lt;br /&gt;
  ~/.pyenv/versions&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
  pyenv root&lt;br /&gt;
&lt;br /&gt;
== Set Python version ==&lt;br /&gt;
To see all the installed versions.&lt;br /&gt;
  pyenv versions&lt;br /&gt;
&lt;br /&gt;
This will set the local python command to a version.  You can also use 'global'.&lt;br /&gt;
  pyenv local 3.9.14&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Containerfile</id>
		<title>Containerfile</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Containerfile"/>
				<updated>2023-01-17T17:52:14Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Containerfile and Dockerfile are interchangeable for the most part.&lt;br /&gt;
&lt;br /&gt;
OCI prefers the generic term Containerfile.&lt;br /&gt;
&lt;br /&gt;
== WORKDIR ==&lt;br /&gt;
This set the working directory, it will also create the directory if it doesn't exists.&lt;br /&gt;
  WORKDIR /opt&lt;br /&gt;
&lt;br /&gt;
== COPY ==&lt;br /&gt;
This will copy a file from the local host to the container.&lt;br /&gt;
  COPY app.tar /app&lt;br /&gt;
&lt;br /&gt;
* user ADD if you want to have more options, like auto extract and git pulls.&lt;br /&gt;
&lt;br /&gt;
== ENV ==&lt;br /&gt;
To set an environment variable.&lt;br /&gt;
  ENV EXAMPLE=/opt/example&lt;br /&gt;
  ENV APP_PROFILE=dev&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Nodejs</id>
		<title>Nodejs</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Nodejs"/>
				<updated>2023-01-05T18:25:06Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to use Require ==&lt;br /&gt;
&lt;br /&gt;
Require will cache objects after it calls them, kind of like a singleton pattern.&lt;br /&gt;
&lt;br /&gt;
To build out an object that require can grab there are a couple of different ways.&lt;br /&gt;
&lt;br /&gt;
The following way will create an object based on a function so it can have private variables.&lt;br /&gt;
&lt;br /&gt;
example.js&lt;br /&gt;
  const exampleService = (function() {&lt;br /&gt;
    const self = this;&lt;br /&gt;
  &lt;br /&gt;
    self.print = function() {&lt;br /&gt;
      console.log('...');&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
    return this;&lt;br /&gt;
  &lt;br /&gt;
  })();&lt;br /&gt;
  module.exports = exampleService;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way is to create a kind of JSON object with functions.&lt;br /&gt;
&lt;br /&gt;
example.js&lt;br /&gt;
  const exampleService = {&lt;br /&gt;
    name: 'example',  &lt;br /&gt;
    print: function() {&lt;br /&gt;
      console.log('...');&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  };&lt;br /&gt;
  module.exports = exampleService;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then you can call them from your script like so.&lt;br /&gt;
  const exampleService = require('./service/example');&lt;br /&gt;
  exampleService.print();&lt;br /&gt;
&lt;br /&gt;
You don't need to add the .js but I think you have to start with '.' directory.&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Dynamodb</id>
		<title>Dynamodb</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Dynamodb"/>
				<updated>2023-01-05T15:29:23Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DynamoDB is an AWS product that has a stand alone app for development but is really suppose to be built out in AWS where they handle the administration/OPS.&lt;br /&gt;
&lt;br /&gt;
This is a NoSQL database.&lt;br /&gt;
&lt;br /&gt;
== DynamoDB Local ==&lt;br /&gt;
Amazon has a local version of the DynamoDB that can be downloaded and ran, for development purposes.&lt;br /&gt;
&lt;br /&gt;
1. Download the dynamodb_local_latest.tar.gz&lt;br /&gt;
2. Extract&lt;br /&gt;
3. Run&lt;br /&gt;
  java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb&lt;br /&gt;
&lt;br /&gt;
When ran a file gets created that holds the data.  If deleted...data lost.&lt;br /&gt;
  shared-local-instance.db&lt;br /&gt;
&lt;br /&gt;
== Partition Key and Sort Key ==&lt;br /&gt;
There are two types of keys that can be used to define a primary key.&lt;br /&gt;
&lt;br /&gt;
Partition keys are the how the database separates data in the backend.  There are used to optimize queries.&lt;br /&gt;
When using `scan`, DynamoDB will go through ever record in the table, when using `query`, it will look in the partition.&lt;br /&gt;
&lt;br /&gt;
Sort keys allow you to sort data by a secondary column.&lt;br /&gt;
&lt;br /&gt;
If more sorting is required, take a look at using Local Global Index.&lt;br /&gt;
&lt;br /&gt;
When adding data, which ever is setup...These fields will be required, all other data is optional.&lt;br /&gt;
&lt;br /&gt;
== Global Secondary Index ==&lt;br /&gt;
This allows you to create a super table from the base table, to allow for different keys and sorting when using the `query` command.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  var AWS = require(&amp;quot;aws-sdk&amp;quot;);&lt;br /&gt;
  AWS.config.update({&lt;br /&gt;
      region: &amp;quot;local&amp;quot;,&lt;br /&gt;
      endpoint: &amp;quot;http://localhost:8000&amp;quot;&lt;br /&gt;
  });&lt;br /&gt;
  var dynamodb = new AWS.DynamoDB();&lt;br /&gt;
  var params = {&lt;br /&gt;
      TableName: &amp;quot;statements&amp;quot;,&lt;br /&gt;
      AttributeDefinitions: [{     // Attributes are the items that are used in the key definitions and GSI/LSI.&lt;br /&gt;
              AttributeName: &amp;quot;id&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;S&amp;quot;   // S - String&lt;br /&gt;
          },&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;time&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;N&amp;quot;   // N - Number&lt;br /&gt;
          },&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;userId&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;S&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
      ],&lt;br /&gt;
      KeySchema: [{&lt;br /&gt;
              AttributeName: &amp;quot;id&amp;quot;,&lt;br /&gt;
              KeyType: &amp;quot;HASH&amp;quot;&lt;br /&gt;
          }, //Partition key&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;userId&amp;quot;,&lt;br /&gt;
              KeyType: &amp;quot;RANGE&amp;quot;&lt;br /&gt;
          }, //Sort key &lt;br /&gt;
      ],&lt;br /&gt;
      GlobalSecondaryIndexes: [{&lt;br /&gt;
          IndexName: 'statement_user_index',&lt;br /&gt;
          KeySchema: [{&lt;br /&gt;
                  AttributeName: 'userId',&lt;br /&gt;
                  KeyType: 'HASH',&lt;br /&gt;
              },&lt;br /&gt;
              {&lt;br /&gt;
                  AttributeName: 'time',&lt;br /&gt;
                  KeyType: 'RANGE',&lt;br /&gt;
              }&lt;br /&gt;
          ],&lt;br /&gt;
          Projection: {&lt;br /&gt;
              ProjectionType: 'ALL'    // KEY_ONLY, INCLUDE, ALL - This holds the columns that are used in the GSI and returned when queried.&lt;br /&gt;
          },&lt;br /&gt;
          ProvisionedThroughput: {&lt;br /&gt;
              WriteCapacityUnits: 5,&lt;br /&gt;
              ReadCapacityUnits: 5&lt;br /&gt;
          }&lt;br /&gt;
      }],&lt;br /&gt;
      ProvisionedThroughput: {&lt;br /&gt;
          ReadCapacityUnits: 5,&lt;br /&gt;
          WriteCapacityUnits: 5&lt;br /&gt;
      }&lt;br /&gt;
  };&lt;br /&gt;
  dynamodb.createTable(params, function(err, data) {&lt;br /&gt;
      if (err) {&lt;br /&gt;
          console.error(&amp;quot;Unable to create table. Error JSON:&amp;quot;, JSON.stringify(err, null, 2));&lt;br /&gt;
      } else {&lt;br /&gt;
          console.log(&amp;quot;Created table. Table description JSON:&amp;quot;, JSON.stringify(data, null, 2));&lt;br /&gt;
      }&lt;br /&gt;
  });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example query&lt;br /&gt;
    this.findLatest = async function(table, userId) {&lt;br /&gt;
        var params = {&lt;br /&gt;
            TableName: table,&lt;br /&gt;
            IndexName: 'statement_user_index',     // Must have the indexName too query against an GSI index.&lt;br /&gt;
            KeyConditionExpression: 'userId = :userId',   // Must contain the key&lt;br /&gt;
            ExpressionAttributeValues: { ':userId': userId },  // Used like prepared statements.&lt;br /&gt;
            Limit: 1,  // Number of results returned (optional)&lt;br /&gt;
            ScanIndexForward: false  // Ascending or Descending. (Optional)&lt;br /&gt;
        };&lt;br /&gt;
        try {&lt;br /&gt;
            const results = await docClient.query(params).promise();&lt;br /&gt;
            return results.Items;&lt;br /&gt;
        } catch (err) {&lt;br /&gt;
            console.log(err);&lt;br /&gt;
            throw err;&lt;br /&gt;
        };&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Local Secondary Index ==&lt;br /&gt;
This creates a super table on top of the base table to allow for more sorting abilities only.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
  var AWS = require(&amp;quot;aws-sdk&amp;quot;);&lt;br /&gt;
  AWS.config.update({&lt;br /&gt;
      region: &amp;quot;local&amp;quot;,&lt;br /&gt;
      endpoint: &amp;quot;http://localhost:8000&amp;quot;&lt;br /&gt;
  });&lt;br /&gt;
  var dynamodb = new AWS.DynamoDB();&lt;br /&gt;
  var params = {&lt;br /&gt;
      TableName: &amp;quot;statements&amp;quot;,&lt;br /&gt;
      AttributeDefinitions: [{     // Attributes are the items that are used in the key definitions and GSI/LSI.&lt;br /&gt;
              AttributeName: &amp;quot;id&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;S&amp;quot;   // S - String&lt;br /&gt;
          },&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;time&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;N&amp;quot;   // N - Number&lt;br /&gt;
          },&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;userId&amp;quot;,&lt;br /&gt;
              AttributeType: &amp;quot;S&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
      ],&lt;br /&gt;
      KeySchema: [{&lt;br /&gt;
              AttributeName: &amp;quot;id&amp;quot;,&lt;br /&gt;
              KeyType: &amp;quot;HASH&amp;quot;&lt;br /&gt;
          }, //Partition key&lt;br /&gt;
          {&lt;br /&gt;
              AttributeName: &amp;quot;userId&amp;quot;,&lt;br /&gt;
              KeyType: &amp;quot;RANGE&amp;quot;&lt;br /&gt;
          }, //Sort key &lt;br /&gt;
      ],&lt;br /&gt;
      LocalSecondaryIndexes: [{&lt;br /&gt;
          IndexName: 'statement_user_index',&lt;br /&gt;
          KeySchema: [{&lt;br /&gt;
                  AttributeName: &amp;quot;id&amp;quot;,   // Must have the same key as the base.&lt;br /&gt;
                  KeyType: &amp;quot;HASH&amp;quot;&lt;br /&gt;
              },&lt;br /&gt;
              {&lt;br /&gt;
                  AttributeName: 'time',  // This is the secondary sort key.&lt;br /&gt;
                  KeyType: 'RANGE',&lt;br /&gt;
              }&lt;br /&gt;
          ],&lt;br /&gt;
          Projection: {&lt;br /&gt;
              ProjectionType: 'ALL'    // KEY_ONLY, INCLUDE, ALL - This holds the columns that are used in the GSI and returned when queried.&lt;br /&gt;
          },&lt;br /&gt;
          ProvisionedThroughput: {&lt;br /&gt;
              WriteCapacityUnits: 5,&lt;br /&gt;
              ReadCapacityUnits: 5&lt;br /&gt;
          }&lt;br /&gt;
      }],&lt;br /&gt;
      ProvisionedThroughput: {&lt;br /&gt;
          ReadCapacityUnits: 5,&lt;br /&gt;
          WriteCapacityUnits: 5&lt;br /&gt;
      }&lt;br /&gt;
  };&lt;br /&gt;
  dynamodb.createTable(params, function(err, data) {&lt;br /&gt;
      if (err) {&lt;br /&gt;
          console.error(&amp;quot;Unable to create table. Error JSON:&amp;quot;, JSON.stringify(err, null, 2));&lt;br /&gt;
      } else {&lt;br /&gt;
          console.log(&amp;quot;Created table. Table description JSON:&amp;quot;, JSON.stringify(data, null, 2));&lt;br /&gt;
      }&lt;br /&gt;
  });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get a record ==&lt;br /&gt;
        var params = {&lt;br /&gt;
            TableName: table,&lt;br /&gt;
            Key: {&lt;br /&gt;
                &amp;quot;id&amp;quot;: id&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
        try {&lt;br /&gt;
            const results = await docClient.get(params).promise();&lt;br /&gt;
            console.log('Find by id ' + id, JSON.stringify(results, null, 2));&lt;br /&gt;
            return results;&lt;br /&gt;
        } catch (err) {&lt;br /&gt;
            console.log(err);&lt;br /&gt;
            throw err;&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add a record ==&lt;br /&gt;
        var params = {&lt;br /&gt;
            TableName: table,&lt;br /&gt;
            Item: entity&lt;br /&gt;
        };&lt;br /&gt;
        try {&lt;br /&gt;
            const results = await docClient.put(params).promise();&lt;br /&gt;
            console.log('Added ', entity);&lt;br /&gt;
            return entity;&lt;br /&gt;
        } catch (err) {&lt;br /&gt;
            console.log(err);&lt;br /&gt;
            throw err;&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Delete a record ==&lt;br /&gt;
        var params = {&lt;br /&gt;
            TableName: table,&lt;br /&gt;
            Key: {&lt;br /&gt;
              id: id&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
        try {&lt;br /&gt;
            const results = await docClient.delete(params).promise();&lt;br /&gt;
            console.log('Removed ' + id + &amp;quot; from &amp;quot; + table);&lt;br /&gt;
            return results;&lt;br /&gt;
        } catch (err) {&lt;br /&gt;
            console.log(err);&lt;br /&gt;
            throw err;&lt;br /&gt;
        };&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Kafka</id>
		<title>Kafka</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Kafka"/>
				<updated>2022-08-24T14:30:19Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Run Kafka in Podman ==&lt;br /&gt;
The following will run Kafka and Zookeeper in Podman, and allow you to connect to localhost:9092.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pull the Zookeeper and Kafka images.&lt;br /&gt;
&lt;br /&gt;
  podman pull bitnami/kafka&lt;br /&gt;
  podman pull bitnami/zookeeper&lt;br /&gt;
&lt;br /&gt;
Create a pod container to place the containers in so they can talk to each other.&lt;br /&gt;
&lt;br /&gt;
  podman pod create \&lt;br /&gt;
    --name kafka-pod \&lt;br /&gt;
    -p 9092:9092 \&lt;br /&gt;
    -p 2181:2181&lt;br /&gt;
&lt;br /&gt;
Start the Zookeeper instance.&lt;br /&gt;
&lt;br /&gt;
  podman run \&lt;br /&gt;
    -d \&lt;br /&gt;
    --pod kafka-pod \&lt;br /&gt;
    --name zookeeper \&lt;br /&gt;
    -e ALLOW_ANONYMOUS_LOGIN=yes \&lt;br /&gt;
    bitnami/zookeeper&lt;br /&gt;
&lt;br /&gt;
Start the Kafka instance.&lt;br /&gt;
&lt;br /&gt;
  podman run \&lt;br /&gt;
    -d \&lt;br /&gt;
    --pod kafka-pod \&lt;br /&gt;
    --name kafka \&lt;br /&gt;
    -e ALLOW_PLAINTEXT_LISTENER=yes \&lt;br /&gt;
    -e KAFKA_CFG_ZOOKEEPER_CONNECT=127.0.0.1:2181 \&lt;br /&gt;
    -e KAFKA_CFG_LISTENERS=PLAINTEXT://:9092 \&lt;br /&gt;
    -e KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \&lt;br /&gt;
    bitnami/kafka&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Linux_arch_install</id>
		<title>Linux arch install</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Linux_arch_install"/>
				<updated>2022-06-22T15:48:15Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here are my steps.  These steps are for bios, NOT uefi&lt;br /&gt;
&lt;br /&gt;
1. Boot in to Arch ISO.&lt;br /&gt;
&lt;br /&gt;
2. Update date time.&lt;br /&gt;
  # timedatectl set-ntp true&lt;br /&gt;
&lt;br /&gt;
3. Setup Partitions&lt;br /&gt;
&lt;br /&gt;
3.a Use lsblk or fdisk -l to find the path of the harddisk.&lt;br /&gt;
  /dev/sda&lt;br /&gt;
&lt;br /&gt;
3.b Start up fdisk to format a harddisk.&lt;br /&gt;
&lt;br /&gt;
  # fdisk /dev/sda&lt;br /&gt;
&lt;br /&gt;
  Remember to change the type for swap to hex '82' or swap&lt;br /&gt;
&lt;br /&gt;
  sda1 - primary - Linux - boot - 1gb&lt;br /&gt;
  sda2 - primary - Linux swap - swap - 1.5 x memmory&lt;br /&gt;
  sda3 - primary - Linux - root - The rest.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.c When all the partitions are setup use 'w' to apply the changes.&lt;br /&gt;
&lt;br /&gt;
  # w&lt;br /&gt;
&lt;br /&gt;
4. Format the new partitions.&lt;br /&gt;
&lt;br /&gt;
  # mkfs.ext2 /dev/sda1&lt;br /&gt;
  # mkswap /dev/sda2&lt;br /&gt;
  # mkfs.ext4 /dev/sda3&lt;br /&gt;
&lt;br /&gt;
5. Mount the new file partitioned file systems and turn swap on.&lt;br /&gt;
&lt;br /&gt;
  # mount /dev/sda3 /mnt&lt;br /&gt;
  # mount --mkdir /dev/sda1 /mnt/boot&lt;br /&gt;
  &lt;br /&gt;
  swapon /dev/sda2&lt;br /&gt;
&lt;br /&gt;
6. Use pacstrap in install arch.&lt;br /&gt;
&lt;br /&gt;
  # pacstrap /mnt base base-devel linux linux-firmware networkmanager vim&lt;br /&gt;
&lt;br /&gt;
7. Generate the fstab file to define the partitions and filesystems&lt;br /&gt;
&lt;br /&gt;
  # genfstab -U /mnt &amp;gt;&amp;gt; /mnt/etc/fstab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. Sudo login in to the system&lt;br /&gt;
&lt;br /&gt;
  # arch-chroot /mnt&lt;br /&gt;
&lt;br /&gt;
9. Set the timezone.&lt;br /&gt;
&lt;br /&gt;
  # ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime&lt;br /&gt;
&lt;br /&gt;
Update the time in /etc/adjtime&lt;br /&gt;
&lt;br /&gt;
  # hwclock --systohc&lt;br /&gt;
&lt;br /&gt;
10. Localization - Edit the file&lt;br /&gt;
&lt;br /&gt;
  vim /etc/locale.gen&lt;br /&gt;
&lt;br /&gt;
Uncomment out&lt;br /&gt;
  en_US.UTF-8 UTF-8&lt;br /&gt;
  en_US ISO-8859-1&lt;br /&gt;
&lt;br /&gt;
Generate language file by running the following file.&lt;br /&gt;
  # locale-gen&lt;br /&gt;
&lt;br /&gt;
11. Create and edit the locale.conf.&lt;br /&gt;
&lt;br /&gt;
  # vim /etc/locale.conf&lt;br /&gt;
&lt;br /&gt;
Add the following&lt;br /&gt;
  LANG=en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
12. Set the hostname.&lt;br /&gt;
&lt;br /&gt;
  # echo &amp;quot;archlinux&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
&lt;br /&gt;
13. Set the root password&lt;br /&gt;
&lt;br /&gt;
  # passwd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
14. Install Grub - This is the bootloader&lt;br /&gt;
&lt;br /&gt;
  # pacman -S grub&lt;br /&gt;
  # grub-install --target=i386-pc /dev/sda&lt;br /&gt;
  # grub-mkconfig -o /boot/grub/grub.cfg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15. Enable NetworkManager - To make sure you have internet upon startup.&lt;br /&gt;
&lt;br /&gt;
  # systemctl enable NetworkManager&lt;br /&gt;
&lt;br /&gt;
15. Done.  Now exit, remove the IOS, and restart.&lt;br /&gt;
&lt;br /&gt;
  # exit&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Python_requirements</id>
		<title>Python requirements</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_requirements"/>
				<updated>2022-06-03T14:21:28Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Python Requirements  These are python dependencies that may need to be installed.    To install these dependencies you can use an application called pip.   Install   pip insta...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Python Requirements&lt;br /&gt;
&lt;br /&gt;
These are python dependencies that may need to be installed.  &lt;br /&gt;
&lt;br /&gt;
To install these dependencies you can use an application called pip.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install&lt;br /&gt;
  pip install -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
To see all dependencies and lock all sub dependencies in place.&lt;br /&gt;
  pip freeze &amp;gt; requirements.txt&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Python_ve</id>
		<title>Python ve</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Python_ve"/>
				<updated>2022-06-03T14:08:40Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Python Virtual Environments  A python virtual environment is a way of setting up a python project in a environment sandbox.  Create the environment   python3 -m venv env  Acti...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Python Virtual Environments&lt;br /&gt;
&lt;br /&gt;
A python virtual environment is a way of setting up a python project in a environment sandbox.&lt;br /&gt;
&lt;br /&gt;
Create the environment&lt;br /&gt;
  python3 -m venv env&lt;br /&gt;
&lt;br /&gt;
Activate the environment&lt;br /&gt;
  source ./env/bin/activate&lt;br /&gt;
&lt;br /&gt;
Deactivate the environment&lt;br /&gt;
  ./deactivate&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Linux_cert_install</id>
		<title>Linux cert install</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Linux_cert_install"/>
				<updated>2022-05-24T19:05:02Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;If you having trouble with cert issues in Alpine Linux try the following.  Copy the perm file to the following directory.   cp ./my_cert.pem /usr/local/share/ca-certificates/...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you having trouble with cert issues in Alpine Linux try the following.&lt;br /&gt;
&lt;br /&gt;
Copy the perm file to the following directory.&lt;br /&gt;
  cp ./my_cert.pem /usr/local/share/ca-certificates/&lt;br /&gt;
&lt;br /&gt;
Then run the following command to update your systems certs.&lt;br /&gt;
  update-ca-certificates&lt;br /&gt;
&lt;br /&gt;
* This command updates all the certs in the /etc/ssl/certs folder with the certs listed in /etc/ca-certificates.conf and all certs in the /usr/local/share/ca-certificates directory.&lt;br /&gt;
&lt;br /&gt;
Resource&lt;br /&gt;
https://manpages.ubuntu.com/manpages/xenial/man8/update-ca-certificates.8.html&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Osx-nginx</id>
		<title>Osx-nginx</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Osx-nginx"/>
				<updated>2022-05-18T23:28:01Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install Nginx on OSX.&lt;br /&gt;
&lt;br /&gt;
1. Download Nginx.&lt;br /&gt;
2. Extract&lt;br /&gt;
3. Run the following&lt;br /&gt;
  ./configure&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
It will install Nginx to /usr/local/nginx&lt;br /&gt;
&lt;br /&gt;
Nginx will default to port 80.&lt;br /&gt;
&lt;br /&gt;
== Start/Stop ==&lt;br /&gt;
To start Nginx&lt;br /&gt;
  cd /usr/local/nginx/sbin&lt;br /&gt;
  sudo ./nginx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To stop Nginx&lt;br /&gt;
  ps aux | grep nginx&lt;br /&gt;
  kill [nginx_pid]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Helm</id>
		<title>Helm</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Helm"/>
				<updated>2022-04-28T18:56:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Helm is a package manager for Kubernetes.&lt;br /&gt;
&lt;br /&gt;
Things I found out while working with Helm.&lt;br /&gt;
  - You do not need name spaces.&lt;br /&gt;
&lt;br /&gt;
To help with debugging add the following&lt;br /&gt;
  --debug&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Process a single manifest and see the results.&lt;br /&gt;
  helm template -s templates/application-service.yaml app-project&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
  helm template -f ../environments/dv.yaml -s templates/application-service.yaml . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
List all helm installs&lt;br /&gt;
  helm list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install a helm chart&lt;br /&gt;
  helm install [project_name] [helm_chart_name]&lt;br /&gt;
  &lt;br /&gt;
  example:&lt;br /&gt;
    helm install helm-test test-project&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update a helm chart&lt;br /&gt;
  helm upgrade [project_name] [helm_chart_name]&lt;br /&gt;
&lt;br /&gt;
Remove a helm chart&lt;br /&gt;
  helm upgrade [project_name]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Osx-access-issue</id>
		<title>Osx-access-issue</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Osx-access-issue"/>
				<updated>2022-04-20T14:04:50Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;If you have an application that keeps asking for the root password, you can just give the app access.  These steps were taking from another suggestion for VPN Global protect k...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you have an application that keeps asking for the root password, you can just give the app access.&lt;br /&gt;
&lt;br /&gt;
These steps were taking from another suggestion for VPN Global protect keep asking for the password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  1. In Keychain Access application, locate the Machine Certificate issued to Mac OS X Client in the System keychain. &lt;br /&gt;
  2. Right Click on the private key assoicated with Certificate and click Get Info, then click Access Control tab&lt;br /&gt;
  3. Then click + sign to select an Application to allow&lt;br /&gt;
  4. Then press key combiniation &amp;quot;&amp;lt;Command&amp;gt; + &amp;lt;Shift&amp;gt; + G&amp;quot; to open Go to Folder&lt;br /&gt;
  5. Enter &amp;quot;/Applications/GlobalProtect.app/Contents/Resources and click Go&lt;br /&gt;
  6. Find PanGPS and click, then press Add&lt;br /&gt;
  7. Save Changes to private key&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Kubectl</id>
		<title>Kubectl</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Kubectl"/>
				<updated>2022-04-11T14:06:26Z</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/Podman</id>
		<title>Podman</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Podman"/>
				<updated>2022-04-06T15:58:39Z</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/Minikube</id>
		<title>Minikube</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Minikube"/>
				<updated>2022-04-04T21:23:01Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Minikube is an application that sets up a local single node Kubernetes cluster.&lt;br /&gt;
&lt;br /&gt;
Start Minikube&lt;br /&gt;
  minikube start&lt;br /&gt;
&lt;br /&gt;
Stop Minikube&lt;br /&gt;
  minikube stop&lt;br /&gt;
&lt;br /&gt;
Clean up Minikube&lt;br /&gt;
  minikube delete&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Pull Local Images'''&lt;br /&gt;
&lt;br /&gt;
Pull images from localhost podman&lt;br /&gt;
  eval $(minikube podman-env)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pull images from localhost Docker&lt;br /&gt;
  eval $(minikube docker-env)&lt;br /&gt;
&lt;br /&gt;
Also we need to set the ImagePullPolicy to Never in order to use local docker images.&lt;br /&gt;
&lt;br /&gt;
To get an image inside minikube.&lt;br /&gt;
  minikube cache add [image-name]:[tag]&lt;br /&gt;
&lt;br /&gt;
or this might work, haven't tried yet.&lt;br /&gt;
  minikube image load my_image&lt;br /&gt;
&lt;br /&gt;
'''Dashboard'''&lt;br /&gt;
&lt;br /&gt;
This starts up a dashboard to show all the different items.&lt;br /&gt;
&lt;br /&gt;
  minikube dashboard&lt;br /&gt;
&lt;br /&gt;
'''SSH'''&lt;br /&gt;
  minikube ssh&lt;br /&gt;
&lt;br /&gt;
'''ip'''&lt;br /&gt;
  minikube ip&lt;br /&gt;
&lt;br /&gt;
== Ingress ==&lt;br /&gt;
You need to enable ingress.&lt;br /&gt;
  minikube addons enable ingress&lt;br /&gt;
&lt;br /&gt;
To expose minikube to localhost&lt;br /&gt;
  minikube tunnel --cleanup&lt;br /&gt;
&lt;br /&gt;
This will allow you to hit localhost:80 to reach the ingress controller.&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Kubernetes</id>
		<title>Kubernetes</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Kubernetes"/>
				<updated>2022-04-04T19:39:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Configurations YAML File ==&lt;br /&gt;
&lt;br /&gt;
Deployment&lt;br /&gt;
&lt;br /&gt;
  - kind: Deployment&lt;br /&gt;
    apiVersion: apps/v1&lt;br /&gt;
    metadata:&lt;br /&gt;
      name: app-deployment&lt;br /&gt;
      namespace: app-ns&lt;br /&gt;
    spec:&lt;br /&gt;
      replicas: 1&lt;br /&gt;
      selector:&lt;br /&gt;
        matchLabels:&lt;br /&gt;
          app: my-app&lt;br /&gt;
      template:&lt;br /&gt;
        metadata:&lt;br /&gt;
          labels:&lt;br /&gt;
            app: my-app&lt;br /&gt;
        spec:&lt;br /&gt;
          volumes:&lt;br /&gt;
            - name: app-secrets-volume&lt;br /&gt;
              secret:&lt;br /&gt;
                secretName: my-secret&lt;br /&gt;
          containers:&lt;br /&gt;
            - image: ${CONTAINER_REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG}&lt;br /&gt;
              name: my-app&lt;br /&gt;
              ports:&lt;br /&gt;
                 - containerPort: 8080&lt;br /&gt;
              envFrom:&lt;br /&gt;
                - configMapRef:&lt;br /&gt;
                   name: app-config&lt;br /&gt;
                - secretRef:&lt;br /&gt;
                   name: my-secrets&lt;br /&gt;
              env:&lt;br /&gt;
                - name: CUSTOM_ENV_VAR&lt;br /&gt;
                  value: &amp;quot;soon_to_come&amp;quot;&lt;br /&gt;
              volumeMounts:&lt;br /&gt;
                - name: app-secrets-volume&lt;br /&gt;
                  mountPath: /opt/my-app/secrets-volume&lt;br /&gt;
                  readOnly: true&lt;br /&gt;
          restartPolicy: Always&lt;br /&gt;
          terminationGracePeriodSeconds: 30&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Service&lt;br /&gt;
&lt;br /&gt;
  - kind: Service&lt;br /&gt;
    apiVersion: v1&lt;br /&gt;
    metadata:&lt;br /&gt;
      name: app-service&lt;br /&gt;
      namespace: app-ns&lt;br /&gt;
    spec:&lt;br /&gt;
      ports:&lt;br /&gt;
        - port: 8080&lt;br /&gt;
          targetPort: 8080&lt;br /&gt;
      selector:&lt;br /&gt;
        app: my-app&lt;br /&gt;
&lt;br /&gt;
Use the following option to make the service Headless, this is good when each of the pods has state and the state could be different between them.  This exposes each pods ip through a DNS lookup.&lt;br /&gt;
  Service.spec.clusterIP: None&lt;br /&gt;
&lt;br /&gt;
ConfigMap&lt;br /&gt;
&lt;br /&gt;
  # ConfigMap Configuration&lt;br /&gt;
  - kind: ConfigMap&lt;br /&gt;
    apiVersion: v1&lt;br /&gt;
    metadata:&lt;br /&gt;
      name: app-config&lt;br /&gt;
      namespace: app-ns&lt;br /&gt;
    data:&lt;br /&gt;
      CONFIG_TEMP: soon-to-come&lt;br /&gt;
&lt;br /&gt;
Templates&lt;br /&gt;
&lt;br /&gt;
To use templates, allows for values to be injected.&lt;br /&gt;
&lt;br /&gt;
  kind: Template&lt;br /&gt;
  apiVersion: template.openshift.io/v1&lt;br /&gt;
  metadata:&lt;br /&gt;
    name: my-project&lt;br /&gt;
    annotations:&lt;br /&gt;
      description: &amp;quot;This is my project&amp;quot;&lt;br /&gt;
      tags: &amp;quot;java,project,other&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  objects:&lt;br /&gt;
   ...&lt;br /&gt;
&lt;br /&gt;
  # Template Parameters&lt;br /&gt;
  parameters:&lt;br /&gt;
    - description: &amp;quot;This param is an example&amp;quot;&lt;br /&gt;
      required: true&lt;br /&gt;
      name: PARAM_1&lt;br /&gt;
    - description: &amp;quot;To use the param use the dollar sign followed by braces.&amp;quot;&lt;br /&gt;
      required: true&lt;br /&gt;
      name: IMAGE_NAME&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then to use the params inline, use&lt;br /&gt;
  ${PARAM_1}&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Buildah</id>
		<title>Buildah</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Buildah"/>
				<updated>2022-04-04T19:31:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tool is used to build images.&lt;br /&gt;
&lt;br /&gt;
Build an image&lt;br /&gt;
  buildah bud -t {image}:{tag}&lt;br /&gt;
&lt;br /&gt;
List all images&lt;br /&gt;
  buildah images&lt;br /&gt;
&lt;br /&gt;
Build using a Dockerfile&lt;br /&gt;
  buildah build-using-dockerfile --format docker --file Dockerfile --tag cs:latest&lt;br /&gt;
&lt;br /&gt;
Push image to a local file as oci format&lt;br /&gt;
  -- Build in OCI format for running in Podman.&lt;br /&gt;
  buildah push --format oci localhost/cs:latest  oci-archive:/app/target/cs-oci.tar&lt;br /&gt;
  &lt;br /&gt;
  -- Build in docker format and run in docker.&lt;br /&gt;
  buildah push --format docker localhost/cs-docker:latest  docker-archive:/app/target/cs-docker2.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run buildah using docker&lt;br /&gt;
  docker run -it \&lt;br /&gt;
    --security-opt seccomp=unconfined \&lt;br /&gt;
    --security-opt apparmor=unconfined \&lt;br /&gt;
    --device /dev/fuse \&lt;br /&gt;
    --entrypoint &amp;quot;/bin/bash&amp;quot; \&lt;br /&gt;
    quay.io/buildah/stable&lt;br /&gt;
&lt;br /&gt;
You need to have the following flags&lt;br /&gt;
  --security-opt seccomp=unconfined&lt;br /&gt;
  --security-opt apparmor=unconfined&lt;br /&gt;
  --device /dev/fuse&lt;br /&gt;
&lt;br /&gt;
seccomp - Docker restricts using unshare system call inside a containers.&lt;br /&gt;
&lt;br /&gt;
apparmor - This flag is required.&lt;br /&gt;
&lt;br /&gt;
/dev/fuse - This is needed to use the fuse-overlay program inside the container rather then using the host kernel overlay.&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Openshift</id>
		<title>Openshift</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Openshift"/>
				<updated>2022-04-04T19:29:56Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;RedHat OpenShift&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenShift CLI - OC ==&lt;br /&gt;
&lt;br /&gt;
Switch Projects.&lt;br /&gt;
  oc project ${project_name}&lt;br /&gt;
&lt;br /&gt;
This will process a Kubernetes template with a param file.&lt;br /&gt;
  oc process -f templates/template.yaml --param-file=parameters/dev.yaml --ignore-unknown-parameters=true | oc apply -f-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After applying a deployment you need to restart the OpenShift containers.&lt;br /&gt;
  oc rollout resume deployment/${deployment_name}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scale deployment to 0&lt;br /&gt;
  oc get deployment -o name # Get the deployment names&lt;br /&gt;
  oc scale --replicas=0 [deployment_name]&lt;br /&gt;
  &lt;br /&gt;
  Example:&lt;br /&gt;
  oc scale --replicas=0 deployment.apps/test-deployment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get all events&lt;br /&gt;
  oc get events&lt;br /&gt;
&lt;br /&gt;
Get all pods&lt;br /&gt;
  oc get pods&lt;br /&gt;
&lt;br /&gt;
Connect to pod - terminal&lt;br /&gt;
  oc rsh {pod}&lt;br /&gt;
&lt;br /&gt;
Open a tunnel to a pod&lt;br /&gt;
  oc port-forward $POD_NAME 5432 &amp;gt; port-forward.log &amp;amp;&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	<entry>
		<id>http://wiki.johnfreier.com/index.php/Iac</id>
		<title>Iac</title>
		<link rel="alternate" type="text/html" href="http://wiki.johnfreier.com/index.php/Iac"/>
				<updated>2022-04-04T17:52:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jfreier: Created page with &amp;quot;Infrastructure As Code  Docker&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Infrastructure As Code&lt;br /&gt;
&lt;br /&gt;
[[docker|Docker]]&lt;/div&gt;</summary>
		<author><name>Jfreier</name></author>	</entry>

	</feed>