<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>DevOps on Piotr Kosmowski</title>
    <link>/docs/notes/devops/</link>
    <description>Recent content in DevOps on Piotr Kosmowski</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>pl-pl</language><atom:link href="/docs/notes/devops/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Containers</title>
      <link>/docs/notes/devops/containers/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/containers/</guid>
      <description>Init # docker run hello-world - run container from hello world image Samples # Application # cat &amp;gt; app.js &amp;lt;&amp;lt;EOF const http = require(&amp;#39;http&amp;#39;); const hostname = &amp;#39;0.0.0.0&amp;#39;; const port = 80; const server = http.createServer((req, res) =&amp;gt; { res.statusCode = 200; res.setHeader(&amp;#39;Content-Type&amp;#39;, &amp;#39;text/plain&amp;#39;); res.end(&amp;#39;Hello World\n&amp;#39;); }); server.listen(port, hostname, () =&amp;gt; { console.log(&amp;#39;Server running at http://%s:%s/&amp;#39;, hostname, port); }); process.on(&amp;#39;SIGINT&amp;#39;, function() { console.log(&amp;#39;Caught interrupt signal and will exit&amp;#39;); process.exit(); }); EOF Dockerfile # cat &amp;gt; Dockerfile &amp;lt;&amp;lt;EOF # Use an official Node runtime as the parent image FROM node:6 # Set the working directory in the container to /app WORKDIR /app # Copy the current directory contents into the container at /app ADD .</description>
    </item>
    
    <item>
      <title>GCP</title>
      <link>/docs/notes/devops/gcp/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/gcp/</guid>
      <description> Init # gcloud auth application-default login - acquire new user credentials to use for Application Default Credentials </description>
    </item>
    
    <item>
      <title>GIT</title>
      <link>/docs/notes/devops/git/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/git/</guid>
      <description>Basic commands # git init - Init local repo git status - displays status of the repository git diff --staged - diff to staged (commited) files to local repo git add -all - Add all changed, new and removed files git commit -m &amp;quot;Commit message&amp;quot; - performs commit of added files to the local repository git remote add origin https://github.com/kospiotr/sample-repo.git - add remote repository link to local repository git push origin master - transfers changes from local to remote repositories git push -u origin master - remember settings that next time you can use only git push git push origin --all - push everything to remote repository including branches git add --all &amp;amp; git commit -m &amp;quot;Update&amp;quot; &amp;amp; git push - add all, commit and push together git checkout discard changes in working directory git reset --hard - all changes will be reverted git clean -df - clean all untracked directories and files git clean -df &amp;amp;&amp;amp; git reset --hard &amp;amp;&amp;amp; git pull - discards any change and updates branch git branch | grep -v &amp;quot;master&amp;quot; | xargs git branch -d - removes all branchces except master and current Excluding files from repository # Reference: http://git-scm.</description>
    </item>
    
    <item>
      <title>Jenkins</title>
      <link>/docs/notes/devops/jenkins/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/jenkins/</guid>
      <description>Install # Create user: sudo adduser jenkins Add jenkins user as sudoer: sudo adduser jenkins sudo Login to that user: su jenkins Download Jenkins: wget http://mirrors.jenkins.io/war/latest/jenkins.war Create systemd init configuration in file: sudo vim /etc/systemd/system/jenkins.service with following content: [Unit] Description=Jenkins Daemon [Service] ExecStart=/usr/bin/java -jar /home/jenkins/jenkins.war --httpPort=8081 User=jenkins [Install] WantedBy=multi-user.target Reload service manager: sudo systemctl daemon-reload and you can now manage the service: systemctl start jenkins.service # starts the service manually systemctl stop jenkins.</description>
    </item>
    
    <item>
      <title>Kubernetes</title>
      <link>/docs/notes/devops/kubernetes/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/kubernetes/</guid>
      <description>https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/ source &amp;lt;(kubectl completion bash) Samples # Application # cat &amp;gt; app.js &amp;lt;&amp;lt;EOF const http = require(&amp;#39;http&amp;#39;); const os = require(&amp;#34;os&amp;#34;); const hostname = &amp;#39;0.0.0.0&amp;#39;; const port = 80; const server = http.createServer((req, res) =&amp;gt; { console.log(&amp;#39;Request: &amp;#39; + req.url); res.statusCode = 200; res.setHeader(&amp;#39;Content-Type&amp;#39;, &amp;#39;text/plain&amp;#39;); res.end(&amp;#39;Hello World from &amp;#39; + os.hostname() + &amp;#39;\n&amp;#39;); }); server.listen(port, hostname, () =&amp;gt; { console.log(&amp;#39;Server running at http://%s:%s/&amp;#39;, hostname, port); }); process.on(&amp;#39;SIGINT&amp;#39;, function() { console.</description>
    </item>
    
    <item>
      <title>Unix</title>
      <link>/docs/notes/devops/unix/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/unix/</guid>
      <description>Commands # apt-cache policy &amp;lt;packageName&amp;gt; - check available version du -sh * - list all directories and files with its real size du -h * | sort -r | head -50 - 50 heaviest subdirectories with size tar -cvf archived-file.tar ./directory-to-archive - tar directory to file tar - xvf archived-file.tar - untar directory to file tar -czvf archived-file.tar.gz ./directory-to-archive - tar.gz directory to file tar - xzvf archived-file.tar.gz - untar.</description>
    </item>
    
    <item>
      <title>WSL</title>
      <link>/docs/notes/devops/wsl/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/notes/devops/wsl/</guid>
      <description>Installation # wsl --install Fixing DNS # From: https://superuser.com/questions/1191249/unable-to-resolve-host-name-in-wsl
Create a wsl.conf file in the root etc folder (you may need sudo):
sudo nano /etc/wsl.conf Paste the following lines in the file and exit saving it (Ctrl+X):
[network] generateResolvConf = false Delete the symbolic link to the resolv.conf file:
cd /etc sudo rm resolv.conf Create a new resolv.conf file in /etc:
sudo nano resolv.conf Paste the following content into it saving it with (Ctrl+O and Ctrl+X):</description>
    </item>
    
  </channel>
</rss>
