<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>arainho ~$ ./blog --list</title>
    <description>$ cat blog | while read post; do echo $post; done
</description>
    <link>http://blog.arainho.me/</link>
    <atom:link href="http://blog.arainho.me/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 27 May 2022 22:20:41 +0000</pubDate>
    <lastBuildDate>Fri, 27 May 2022 22:20:41 +0000</lastBuildDate>
    <generator>Jekyll v3.9.2</generator>
    
      <item>
        <title>Secure Git Workshop</title>
        <description>&lt;h3 id=&quot;talk---secure-development-with-git&quot;&gt;Talk - Secure development with git&lt;/h3&gt;

&lt;p&gt;I did a talk &amp;amp; demo called “Secure development with git” last Wednesday 25th May, on the &lt;a href=&quot;https://cybersecweek.ua.pt/program.html&quot;&gt;UA CyberSecWeek ‘22&lt;/a&gt;, that toke place on &lt;a href=&quot;https://www.ua.pt/deti/&quot;&gt;DETI&lt;/a&gt;, University of Aveiro.&lt;/p&gt;

&lt;p&gt;I created a GitHub repository called &lt;a href=&quot;https://github.com/arainho/secure-git-workshop&quot;&gt;secure-git-workshop&lt;/a&gt; to support the talk.
The presentation slides are available &lt;a href=&quot;https://github.com/arainho/secure-git-workshop/blob/main/assets/git-secure-workshop.pdf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Fri, 27 May 2022 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2022/05/27/secure-git-workshop.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2022/05/27/secure-git-workshop.html</guid>
        
        
      </item>
    
      <item>
        <title>Colima Sharing File Issues</title>
        <description>&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;After Docker Desktop changed its new licensing schema, some people went after alternatives such as a Linux VM with docker daemon inside, minikube, Rancher Desktop, and Colima.   &lt;br /&gt;
I tried them all and end up in Colima after issues with sharing folders/files between host and containers and also port forwarding.&lt;/p&gt;

&lt;p&gt;“Now let me show you what happens when I share a file from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/file&lt;/code&gt; to a docker container with Colima …”&lt;/p&gt;

&lt;p&gt;It’s 28th April and I’m using the following software versions:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker client version: 20.10.12
colima version: 0.3.4
macOS: 11.6.5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;the-colima-sharing-file-issue&quot;&gt;The colima sharing file issue&lt;/h3&gt;
&lt;p&gt;The steps to reproduce the issue are the following:&lt;/p&gt;

&lt;p&gt;Download and ensure file is present.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /tmp/config.yaml https://example.com/config.yaml
&lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /tmp/config.yaml &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;it's a file&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Removing any config file from colima Linux VM.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;colima ssh &lt;span class=&quot;nb&quot;&gt;exec sudo rmdir&lt;/span&gt; /tmp/config&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Try to share a file whitin a container.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run &lt;span class=&quot;nt&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; /tmp/config.yaml:/opt/config.yaml alpine /bin/sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;test -d /opt/config.yaml &amp;amp;&amp;amp; echo it&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;s a directory&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;colima ends up creating a directory !&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;colima ssh &lt;span class=&quot;nb&quot;&gt;exec ls&lt;/span&gt; /tmp/config.yaml &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Remove the file from your macOS host&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /tmp/config.yaml
&lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /tmp/config.yaml &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;config.yaml not found&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the directory remains in colima Linux VM  !&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;colima ssh &lt;span class=&quot;nb&quot;&gt;exec ls&lt;/span&gt; /tmp/config.yaml &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now use other container to share /tmp from host and you have “trash” from colima’s /tmp&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run &lt;span class=&quot;nt&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; /tmp:/opt ubuntu /bin/sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;test -d /opt/config.yaml &amp;amp;&amp;amp; ls -ld /opt/config.yaml&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Stop and start colima Linux VM, and /tmp/config.yaml dir remains there !&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;colima stop
colima start
colima ssh &lt;span class=&quot;nb&quot;&gt;exec ls&lt;/span&gt; /tmp/config.yaml &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;solution&quot;&gt;Solution&lt;/h3&gt;
&lt;p&gt;It’s 29th April and I open a &lt;a href=&quot;https://github.com/abiosoft/colima/issues/267&quot;&gt;issue#267&lt;/a&gt; in the Colima GitHub repository and receive a response.&lt;/p&gt;

&lt;p&gt;Only two host directories are available to the Linux VM and Docker containers: $HOME and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/colima&lt;/code&gt;. 
I need to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/colima/file&lt;/code&gt; instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/file&lt;/code&gt; and after that, I’m able to share a file from host to container.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run &lt;span class=&quot;nt&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; /tmp/config.yaml:/opt/config.yaml alpine /bin/sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;test -d /opt/config.yaml &amp;amp;&amp;amp; echo it&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;s a directory&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Fri, 29 Apr 2022 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2022/04/29/colima-sharing-file-issues.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2022/04/29/colima-sharing-file-issues.html</guid>
        
        
      </item>
    
      <item>
        <title>Awesome Api Security</title>
        <description>&lt;p&gt;&lt;a href=&quot;https://github.com/arainho/awesome-api-security&quot;&gt;awesome-apisec&lt;/a&gt; (aka awesome-api-security) is a collection of awesome API Security tools and resources that reaches 1k stars today :-D&lt;/p&gt;

&lt;p&gt;I created a repository on GitHub related to API security in August 2020 with an &lt;a href=&quot;https://github.com/arainho/awesome-api-security/commit/373a99b514eb2f35b482d7ea7e94f13d2a3d6ad6&quot;&gt;initial commit&lt;/a&gt; and started as a personal list of bookmarks.
It evolved, I started to invest in it,  learn and experiment more about the topic ending up adding more resources to it.&lt;/p&gt;

&lt;p&gt;In 2021 APIsecurity.io referenced my repo in a &lt;a href=&quot;https://apisecurity.io/issue-162-compromised-googe-cloud-accounts-graphql-as-api-gateway-api-security-guide-and-training/&quot;&gt;newsletter&lt;/a&gt;, also on their &lt;a href=&quot;https://twitter.com/apisecurityio/status/1404423379197652993&quot;&gt;twitter&lt;/a&gt;, the Bug Bounty Hunter reference it in 2022 on &lt;a href=&quot;https://twitter.com/tbbhunter/status/1478750754844422144&quot;&gt;twitter&lt;/a&gt;, and people started to add it to their favorites.
I ended up having 400 stars in December 2021, now I have 1k ;-)&lt;/p&gt;

&lt;p&gt;Thank you all that found the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awesome-api-security&lt;/code&gt; repo useful.&lt;/p&gt;

</description>
        <pubDate>Fri, 11 Feb 2022 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2022/02/11/awesome-api-security.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2022/02/11/awesome-api-security.html</guid>
        
        
      </item>
    
      <item>
        <title>My Msc</title>
        <description>&lt;p&gt;I defended my Master’s dissertation on &lt;a href=&quot;https://www.ua.pt/pt/noticias/10/65849&quot;&gt;February 8, 2021&lt;/a&gt; at the University of Aveiro, Portugal, Europe (WEST)
I take this opportunity to thank my advisors for all the support, dedication, and patience throughout the process.&lt;/p&gt;

&lt;p&gt;The dissertation is entitled &lt;a href=&quot;https://ria.ua.pt/bitstream/10773/31292/1/Documento_Andr%c3%a9_Br%c3%a1s.pdf&quot;&gt;Container security in CI / CD pipelines&lt;/a&gt; and is available online at &lt;a href=&quot;http://hdl.handle.net/10773/31292&quot;&gt;RIA&lt;/a&gt;, the Institutional repository of University of Aveiro (UA).&lt;/p&gt;

&lt;p&gt;This dissertation aims to reduce the impact of microservices’ vulnerabilities by examining the respective images and containers through a flexible and adaptable set of analysis tools running in dedicated CI/CD pipelines. This approach intends to provide a clean and secure collection of microservices for later release in cloud production environments. To achieve this purpose, we have developed a solution that allows programming and orchestrating a battery of tests. There is a form where we can select several security analysis tools, and the solution performs this set of tests in a controlled way according to the defined dependencies.&lt;/p&gt;

&lt;p&gt;To demonstrate the solution’s effectiveness, we program a battery of tests for different scenarios, defining the security analysis pipeline to incorporate various tools. Finally, we will show security tools working locally, which subsequently integrated into our solution return the same results.&lt;/p&gt;

&lt;p&gt;The developed code and pipeline samples are available on &lt;a href=&quot;https://gitlab.com/secureapps-ci/api_server&quot;&gt;gitlab.com/secureapps-ci&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 04 May 2021 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2021/05/04/my-MSc.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2021/05/04/my-MSc.html</guid>
        
        
      </item>
    
      <item>
        <title>Usbarmory Interlock</title>
        <description>&lt;h1 id=&quot;usbarmory-interlock&quot;&gt;usbarmory-interlock&lt;/h1&gt;

&lt;p&gt;The purpose is to install &lt;a href=&quot;https://github.com/f-secure-foundry/interlock&quot;&gt;INTERLOCK&lt;/a&gt; in usbarmory Mk I with &lt;a href=&quot;https://github.com/f-secure-foundry/usbarmory-debian-base_image&quot;&gt;usbarmory-debian-base_image&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can check my &lt;a href=&quot;https://github.com/arainho/arainho.github.io/blob/master/_posts/2019-04-19-usbarmory-setup.md&quot;&gt;previous post&lt;/a&gt; to check how to prepare burn usbarmory-debian-base_image, connect to usbarmory via ssh / serial.&lt;/p&gt;

&lt;p&gt;The INTERLOCK app is a file encryption front-end, that consists of a web-based file manager running JSON application server on a device hosting an encrypted partition.&lt;/p&gt;

&lt;p&gt;The main features of INTERLOCK are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;a file manager that allows uploading/downloading of files to/from the encrypted partition&lt;/li&gt;
  &lt;li&gt;symmetric/asymmetric cryptographic operations on the individual files&lt;/li&gt;
  &lt;li&gt;secure messaging and file sharing supported with an optional built-in Signal client.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The script to install and setup interlock is &lt;script src=&quot;https://gist.github.com/arainho/5d9e31a8d5d8e432838e405ddb43ae8b.js&quot;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;h3 id=&quot;notes&quot;&gt;notes&lt;/h3&gt;
&lt;p&gt;If you prefer Pre-compiled binary releases for ARM targets they are available at &lt;a href=&quot;https://github.com/f-secure-foundry/interlock/releases&quot;&gt;interlock repository&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Wed, 12 Feb 2020 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2020/02/12/usbarmory-interlock.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2020/02/12/usbarmory-interlock.html</guid>
        
        
      </item>
    
      <item>
        <title>Zoom Zero Day</title>
        <description>&lt;p&gt;After the latest news about a zero-day vulnerability in the Zoom client for Mac that allows a malicious website to hijack a user’s web camera without their permission.&lt;/p&gt;

&lt;p&gt;Reading &lt;a href=&quot;https://medium.com/bugbountywriteup/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-your-website-ac75c83f4ef5&quot;&gt;this article&lt;/a&gt; at Medium from a Security Researcher named &lt;a href=&quot;https://medium.com/@jonathan.leitschuh&quot;&gt;Jonathan Leitschuh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I decided to do 3 things&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;uninstall &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zoom.us&lt;/code&gt; application from macOS&lt;/li&gt;
  &lt;li&gt;disable the ability for Zoom to turn on your webcam when joining a meeting&lt;/li&gt;
  &lt;li&gt;shut down and prevent this server from being restored after updates&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To confirm if this server is present run this in your terminal.&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lsof -i :19421 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can use this find commands to search all zoom files and folders in your machine, and complete the public gist.&lt;/p&gt;

&lt;p&gt;find all files&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;find . -type f |&amp;amp;grep -iE &quot;us.zoom|zoom|zoom.us&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;find all folders&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;find . -type d |&amp;amp;grep -iE &quot;us.zoom|zoom|zoom.us&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I created a public gist called &lt;a href=&quot;https://gist.github.com/arainho/c4989631946073f75ee9f8726dcdc9dc#file-zoom_uninstall_macos-sh&quot;&gt;zoom_uninstall_macos-sh&lt;/a&gt; to mitigate these 3 items,&lt;br /&gt;
using a public script from &lt;a href=&quot;https://drive.google.com/drive/folders/1MP0cNLyJjzPLNrvNDCZv9hRuif091f0c&quot;&gt;Zoom Google Drive&lt;/a&gt;, instructions from &lt;a href=&quot;https://medium.com/@jonathan.leitschuh&quot;&gt;Jonathan Leitschuh&lt;/a&gt; referenced in the medium article and also &lt;a href=&quot;https://apple.stackexchange.com/questions/358651/unable-to-completely-uninstall-zoom-meeting-app&quot;&gt;this post&lt;/a&gt; at apple stackexchange.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#!/usr/bin/env bash

echo Stopping Zoom...
pkill &quot;zoom.us&quot;

echo Cleaning Zoom...
echo Cleaning Application Cached Files...
{
  rm -fr -- ~/Library/Application\ Support/zoom.us
  rm -fr -- ~/Library/Application\ Support/ZoomPresence
  rm -fr -- ~/Library/Caches/us.zoom.xos
  rm -fr -- ~/Library/Logs/zoom.us/
  rm -fr -- ~/Library/Logs/zoomRooms/
  rm -fr -- ~/Library/Logs/zoominstall.log
  rm -fr -- ~/Library/Preferences/ZoomChat.plist
  rm -fr -- ~/Library/Preferences/us.zoom.xos.plist
  rm -fr -- ~/Library/Saved\ Application\ State/us.zoom.xos.savedState
}

echo &quot;Cleaning Application...&quot;
{
  rm -fr -- ~/Applications/zoom.us.app
  rm -fr -- ~/.zoomus/ZoomOpener.app
  rm -fr -- ~/.zoomus
}
echo &quot;Removed Application...&quot;

echo &quot;Preventing the vulnerable server from running on your machine...&quot;
# (You may need to run these lines for each user on your machine.)
pkill &quot;ZoomOpener&quot;; rm -rf ~/.zoomus; touch ~/.zoomus &amp;amp;&amp;amp; chmod 000 ~/.zoomus;
pkill &quot;RingCentralOpener&quot;;  rm -rf ~/.ringcentralopener; touch ~/.ringcentralopener &amp;amp;&amp;amp; chmod 000 ~/.ringcentralopener;

echo &quot;Disabling the ability of Zoom to turn on your webcam when joining a meeting...&quot;
defaults write ~/Library/Preferences/us.zoom.config.plist ZDisableVideo 1           # For just your local account

echo &quot;Removing Launch Daemons/Agents and Internet Plug-Ins...&quot;
{
  rm -fr -- ~/Library/LaunchDaemons/us.zoom.rooms.daemon.plist
  rm -fr -- ~/Library/LaunchAgents/us.zoom*
  rm -fr -- ~/Library/Internet\ Plug-Ins/ZoomUsPlugIn.plugin/
}

echo &quot;Switching to a user with sudo privileges to remove more zoom things...&quot;
{
  sudo rm -fr -- /Applications/zoom.us.app
  sudo kextunload -b zoom.us.ZoomAudioDevice
  sudo rm -fr -- /System/Library/Extensions/ZoomAudioDevice.kext
  sudo defaults write /Library/Preferences/us.zoom.config.plist ZDisableVideo 1       # For all users on the machine
  sudo rm -fr -- /Library/Internet\ Plug-Ins/ZoomUsPlugIn.plugin/
  sudo rm -fr -- /Library/LaunchDaemons/us.zoom.rooms.daemon.plist
  sudo rm -fr -- /Library/LaunchAgents/us.zoom*
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Wed, 10 Jul 2019 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2019/07/10/zoom-zero-day.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2019/07/10/zoom-zero-day.html</guid>
        
        
      </item>
    
      <item>
        <title>Usbarmory Setup</title>
        <description>&lt;h1 id=&quot;usbarmory-setup&quot;&gt;usbarmory-setup&lt;/h1&gt;

&lt;p&gt;I order my usbarmory device from &lt;a href=&quot;https://www.crowdsupply.com/inverse-path/usb-armory&quot;&gt;crowdsupply&lt;/a&gt; to Europe, and after more than one month and paying customs duties the armory finally arrived :-)&lt;/p&gt;

&lt;h3 id=&quot;1-preparing-your-own-microsd-card&quot;&gt;1. Preparing your own microSD card&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;ol&gt;
      &lt;li&gt;check &lt;a href=&quot;https://github.com/inversepath/usbarmory/wiki/microSD-compatibility&quot;&gt;microSD-compatibility&lt;/a&gt;&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;ol&gt;
      &lt;li&gt;choose one of the &lt;a href=&quot;https://github.com/inversepath/usbarmory/wiki/Available-images&quot;&gt;available images&lt;/a&gt; for usbarmory.&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;ol&gt;
      &lt;li&gt;&lt;a href=&quot;https://github.com/inversepath/usbarmory-debian-base_image#Installing&quot;&gt;burn&lt;/a&gt; the image into microSD card&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I choose a Samsung microSD and a pre-compiled release of Debian stretch image available &lt;a href=&quot;https://github.com/inversepath/usbarmory-debian-base_image/releases&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;2-connect-to-usbarmory&quot;&gt;2. Connect to usbarmory&lt;/h3&gt;
&lt;p&gt;We have to options to connect with the usbarmory device, via serial or ssh .&lt;/p&gt;

&lt;h4 id=&quot;option-1---serial-interface&quot;&gt;Option 1 - serial interface&lt;/h4&gt;
&lt;p&gt;We can connect to usbarmory serial port through a USB to TTL cable, the breakout header can be accessed as, the breakout header can be accessed as described in &lt;a href=&quot;https://github.com/inversepath/usbarmory/wiki/GPIOs&quot;&gt;gpio page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I solder a header in usbarmory and use pins 1,5,6 to connect ‘usb to ttl’ adapter with silicon CP210x chipset and specific &lt;a href=&quot;https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers&quot;&gt;drivers&lt;/a&gt;.
To connect in macOS use the next command:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;screen /dev/tty.SLAB_USBtoUART 115200
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;option-2---ssh-connection&quot;&gt;Option 2 - ssh connection&lt;/h4&gt;
&lt;p&gt;In this image &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;usbarmory-debian-base_image&lt;/code&gt; usbarmory cames with predefined ipv4 address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.0.0.1&lt;/code&gt;, so set the laptop or workstation ip address to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.0.0.2&lt;/code&gt; and connect to your usbarmory.&lt;/p&gt;

&lt;p&gt;Now we can log in with&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh 10.0.0.1 -l usbarmory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3-additional-setup&quot;&gt;3. Additional setup&lt;/h3&gt;
&lt;p&gt;Create a ssh key pair, and sent it to usbarmory&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh-keygen -t rsa -b 4096 -C &quot;usbarmory key&quot;
ssh-copy-id -i $HOME/.ssh/id_rsa_usbarmory usbarmory@10.0.0.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;notes&quot;&gt;Notes&lt;/h3&gt;
&lt;h4 id=&quot;macos-monterey&quot;&gt;macOS Monterey&lt;/h4&gt;
&lt;p&gt;We need the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CDC Composite Gadget&lt;/code&gt; interface in the macOS Network Preferences.&lt;/p&gt;

&lt;p&gt;Also if we want to share our internet access with the usbarmory device&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;in macOS Monterey set ip address of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;CDC Composite Gadget&lt;/code&gt; interface to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.0.0.2&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;finally set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Enable Internet Sharing&lt;/code&gt; to ON in System Preferences&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;on-other-macos-versions&quot;&gt;on other macOS versions&lt;/h4&gt;
&lt;p&gt;In some case we may need to&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;have &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RNDIS/Ethernet Gadget&lt;/code&gt; interface in the Network Preferences&lt;/li&gt;
  &lt;li&gt;Set usbmory ip to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.2.X/24&lt;/code&gt; and gateway &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.2.1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Set ip address of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RNDIS/Ethernet Gadget&lt;/code&gt; interface to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.2.1&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;finally set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Enable Internet Sharing&lt;/code&gt; to ON in System Preferences&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 19 Apr 2019 00:00:00 +0000</pubDate>
        <link>http://blog.arainho.me/2019/04/19/usbarmory-setup.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/2019/04/19/usbarmory-setup.html</guid>
        
        
      </item>
    
      <item>
        <title>Enable HTTPS on your website with Let’s Encrypt</title>
        <description>&lt;h1 id=&quot;lets-encrypt&quot;&gt;Let’s Encrypt&lt;/h1&gt;
&lt;p&gt;Let’s Encrypt is a new Certificate Authority:
It’s free, automated, and open&lt;/p&gt;

&lt;h1 id=&quot;enable-https-automatically&quot;&gt;Enable HTTPS Automatically&lt;/h1&gt;
&lt;p&gt;Automatically enable HTTPS on your website with EFF’s Certbot, 
deploying Let’s Encrypt certificates.&lt;/p&gt;

&lt;h3 id=&quot;to-install-just-do&quot;&gt;To install just do&lt;/h3&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; /usr/local/bin/ &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit
&lt;/span&gt;wget https://dl.eff.org/certbot-auto
&lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;a+x certbot-auto
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;if-you-would-like-to-generate-specific-certificates-use-the-certonly-command&quot;&gt;If you would like to generate specific certificates, use the certonly command.&lt;/h3&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot-auto &lt;span class=&quot;nt&quot;&gt;--agree-tos&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--email&lt;/span&gt; admin@example.com &lt;span class=&quot;nt&quot;&gt;--apache&lt;/span&gt; certonly &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; example.com &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;add-your-new-certificate-to-apache&quot;&gt;Add your new certificate to Apache&lt;/h3&gt;
&lt;p&gt;In Apache if you need to specify the chain file, otherwise clients will complain about certificate hierarchy in some browsers and Operating Systems.&lt;/p&gt;

&lt;p&gt;vi /etc/apache2/sites-enabled/000-defaul-ssl&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    SSLCertificateFile      /etc/letsencrypt/archive/example.com/cert1.pem
    SSLCertificateKeyFile   /etc/letsencrypt/archive/example.com/privkey1.pem
    SSLCertificateChainFile /etc/letsencrypt/archive/example.com/chain1.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;or-add-the-new-certificate-to-nginx&quot;&gt;Or add the new certificate to nginx&lt;/h3&gt;

&lt;p&gt;vi /etc/nginx/nginx.conf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;automating-renewal&quot;&gt;Automating renewal&lt;/h3&gt;
&lt;p&gt;Let’s Encrypt certificates last for 90 days, 
so it’s highly advisable to renew them automatically!&lt;/p&gt;

&lt;p&gt;We can use &lt;em&gt;pre-hook&lt;/em&gt; and &lt;em&gt;post-hook&lt;/em&gt; to stop services before renewing the certificates and after,
in this case i use &lt;em&gt;apache2&lt;/em&gt; but can be &lt;em&gt;nginx&lt;/em&gt;.
Let’s test automatic renewal for our certificates by running this command:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;certbot-auto renew &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--dry-run&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--force-renew&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--standalone&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--noninteractive&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--pre-hook&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;service apache2 stop&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--post-hook&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;service apache2 start&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And finally add a line to cron, &lt;em&gt;auto-renew-certs.sh&lt;/em&gt; it’s the previous command in a script.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Let's Encrypt &lt;/span&gt;
0 3 1 &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; root /usr/local/bin/auto-renew-certs.sh | mail &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;[Let's Encrypt] monthly renew certs&quot;&lt;/span&gt; admin@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;some-usefull-links&quot;&gt;Some usefull links&lt;/h4&gt;

&lt;p&gt;https://certbot.eff.org/
https://certbot.eff.org/#ubuntuother-apache
https://certbot.eff.org/docs/using.html#renewal
https://certbot.eff.org/docs/using.html#renewing-certificates&lt;/p&gt;
</description>
        <pubDate>Mon, 26 Sep 2016 15:57:00 +0000</pubDate>
        <link>http://blog.arainho.me/$tag1/$tag2/2016/09/26/get-a-certificate-with-lets-encrypt.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/$tag1/$tag2/2016/09/26/get-a-certificate-with-lets-encrypt.html</guid>
        
        
        <category>$tag1</category>
        
        <category>$tag2</category>
        
      </item>
    
      <item>
        <title>Clone disks with dd</title>
        <description>&lt;h4 id=&quot;0--warning---dd-may-damage-your-system-&quot;&gt;0. !!! WARNING !!!  ‘dd’ may damage your system …&lt;/h4&gt;

&lt;p&gt;Please use disks with no data or non critical data, and use &lt;em&gt;dd&lt;/em&gt; with extreme caution.
Test things first, Disks, Flash Drivers and operating systems differ so be carefull.&lt;/p&gt;

&lt;h4 id=&quot;1-before-clonning-lets-check-the-state-our-original-disk-sdc-see-the-rw-flag-bellow-ro&quot;&gt;1. Before clonning let’s check the state our original disk &lt;em&gt;sdc&lt;/em&gt;, see the &lt;em&gt;rw&lt;/em&gt; flag bellow RO.&lt;/h4&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# blockdev -v --getro /dev/sdc&lt;/span&gt;
get read-only: 0

&lt;span class=&quot;c&quot;&gt;# blockdev -v --getro /dev/sdc1&lt;/span&gt;
get read-only: 0

&lt;span class=&quot;c&quot;&gt;# blockdev --report  /dev/sdc&lt;/span&gt;
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096          0   1000204886016   /dev/sdc

&lt;span class=&quot;c&quot;&gt;# blockdev --report  /dev/sdc1&lt;/span&gt;
RO    RA   SSZ   BSZ   StartSec            Size   Device
rw   256   512  4096       2048   1000203091968   /dev/sdc1

&lt;span class=&quot;c&quot;&gt;# hdparm -r1 /dev/sdc&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;2-lock-property-of-device-sdc-this-will-set-the-device-and-partition-to-read-only-mode&quot;&gt;2. Lock property of device &lt;em&gt;sdc&lt;/em&gt;, this will set the device and partition to read-only mode&lt;/h4&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;blockdev &lt;span class=&quot;nt&quot;&gt;--setro&lt;/span&gt; /dev/sdc
blockdev &lt;span class=&quot;nt&quot;&gt;--setro&lt;/span&gt; /dev/sdc1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# blockdev -v --getro /dev/sdc&lt;/span&gt;
get read-only: 1

&lt;span class=&quot;c&quot;&gt;# blockdev -v --getro /dev/sdc1&lt;/span&gt;
get read-only: 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h5 id=&quot;we-also-can-use-the-hdparm-instead-of-blockdev&quot;&gt;We also can use the hdparm instead of blockdev&lt;/h5&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hdparm &lt;span class=&quot;nt&quot;&gt;-r1&lt;/span&gt; /dev/sdc

/dev/sdc:
 setting &lt;span class=&quot;nb&quot;&gt;readonly &lt;/span&gt;to 1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;on&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;nb&quot;&gt;readonly&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;on&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# hdparm -r /dev/sde&lt;/span&gt;

/dev/sde:
 &lt;span class=&quot;nb&quot;&gt;readonly&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;  1 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;on&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;3-insert-the-clean-device&quot;&gt;3. Insert the clean device&lt;/h4&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dmesg &lt;span class=&quot;nt&quot;&gt;-T&lt;/span&gt; 

&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Tue Jul  5 13:13:41 2016]  sdg: sdg1
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Tue Jul  5 13:13:41 2016] sd 5:0:0:0: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;sdg] Attached SCSI disk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;4-clone-the-devices-with-dd&quot;&gt;4. Clone the devices with dd&lt;/h4&gt;

&lt;p&gt;Used &lt;em&gt;device ids&lt;/em&gt; instead of sda, sdX, etc it’s safer. :-)&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-lh&lt;/span&gt; /dev/disk/by-id/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; kingston | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{ print $9}'&lt;/span&gt;
/dev/disk/by-id/usb-Kingston_DT_HyperX_000000-0:0 -&amp;gt; ../../sde
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;option 1 ( safer )&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;progress &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/disk/by-id/usb-Kingston_DT_HyperX_0011100-0:0 /dev/disk/by-id/ata-Hitachi_HDT000_XXX
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;option 2 ( risky )&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo dd &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;progress &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sdc /dev/sdg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In my Arch Linux i have progress with &lt;em&gt;dd&lt;/em&gt; version 8.25,&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# dd --version&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;dd&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;coreutils&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 8.25
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On some of Debian/Ubuntu or other Linux Distro the option is to use &lt;a href=&quot;http://www.garloff.de/kurt/linux/ddrescue/&quot;&gt;dd_rescue&lt;/a&gt;, 
that has progress and other nice features for data recovery.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dd_rescue /dev/sdc /dev/sdg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After using &lt;a href=&quot;http://www.deftlinux.net/&quot;&gt;deftlinux&lt;/a&gt; for some data recovery, i found that is possible to set devices in read only mode. You can check details in the here &lt;a href=&quot;http://www.deftlinux.net/doc/DEFT%20Zero%20-%20Quick%20Guide%20v0.11%20[ENG].pdf&quot;&gt;deft-quickguide&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Tue, 05 Jul 2016 11:51:00 +0000</pubDate>
        <link>http://blog.arainho.me/clone/disks/dd/dd_rescue/2016/07/05/clone-disks-with-dd.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/clone/disks/dd/dd_rescue/2016/07/05/clone-disks-with-dd.html</guid>
        
        
        <category>clone</category>
        
        <category>disks</category>
        
        <category>dd</category>
        
        <category>dd_rescue</category>
        
      </item>
    
      <item>
        <title>Move running process to new screen shell</title>
        <description>&lt;p&gt;In order to move a running process on your current shell to a new screen session,
you can use &lt;a href=&quot;https://github.com/nelhage/reptyr&quot;&gt;reptyr&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/screen/&quot;&gt;screen&lt;/a&gt; or even &lt;a href=&quot;https://tmux.github.io/&quot;&gt;tmux&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Imagine that your connected via ssh to a remote server and your current job is taking to long to complete …
or you forgot to open a tmux or a screen session and launch a long task …&lt;/p&gt;

&lt;p&gt;I found the solution at &lt;a href=&quot;http://serverfault.com/questions/55880/moving-an-already-running-process-to-screen&quot;&gt;serverfault&lt;/a&gt;, and an nice post at &lt;a href=&quot;http://monkeypatch.me/blog/move-a-running-process-to-a-new-screen-shell.html&quot;&gt;monkeypatch&lt;/a&gt; blog.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ htop                 # Launch new process
$ ctrl+z               # Suspend the current process
$ screen               # Launch screen
$ reptyr $(pgrep htop) # Get back the process
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Fri, 01 Jul 2016 09:34:00 +0000</pubDate>
        <link>http://blog.arainho.me/running/process/screen/shell/2016/07/01/move-running-process-2-new-screen-shell.html</link>
        <guid isPermaLink="true">http://blog.arainho.me/running/process/screen/shell/2016/07/01/move-running-process-2-new-screen-shell.html</guid>
        
        
        <category>running</category>
        
        <category>process</category>
        
        <category>screen</category>
        
        <category>shell</category>
        
      </item>
    
  </channel>
</rss>
