<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: De</title>
    <description>The latest articles on DEV Community by De (@tommyy).</description>
    <link>https://dev.to/tommyy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F830141%2Febe51529-16dd-44c6-9877-af4e0c2963d0.jpg</url>
      <title>DEV Community: De</title>
      <link>https://dev.to/tommyy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tommyy"/>
    <language>en</language>
    <item>
      <title>Cats - Meow! 🐱</title>
      <dc:creator>De</dc:creator>
      <pubDate>Mon, 21 Mar 2022 17:52:42 +0000</pubDate>
      <link>https://dev.to/tommyy/cats-meow-1e6e</link>
      <guid>https://dev.to/tommyy/cats-meow-1e6e</guid>
      <description>&lt;p&gt;The cat (Felis catus) is a domestic species of a small carnivorous mammal.&lt;/p&gt;

&lt;p&gt;And is also a standard Unix utility, yay!&lt;/p&gt;

&lt;p&gt;Cat is used to read files sequentially, writing them to standard output.&lt;/p&gt;

&lt;p&gt;Open your terminal; use &lt;strong&gt;touch&lt;/strong&gt; to create a file:&lt;br&gt;
&lt;code&gt;$ touch file&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ echo "Hello World" &amp;gt;&amp;gt; file&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Prints "Hello world"&lt;br&gt;
&lt;code&gt;$ cat file&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy the file contents:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ touch file2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cat file &amp;gt;&amp;gt; file2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Prints "Hello world"&lt;br&gt;
&lt;code&gt;$ cat file2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Concatenate multiple files:&lt;br&gt;
&lt;code&gt;$ touch file3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ cat file file2 &amp;gt;&amp;gt; file3&lt;/code&gt;&lt;/p&gt;

</description>
      <category>cats</category>
      <category>linux</category>
    </item>
    <item>
      <title>Block-chained Domains - Handshake &amp; Decentralized web</title>
      <dc:creator>De</dc:creator>
      <pubDate>Mon, 21 Mar 2022 16:02:13 +0000</pubDate>
      <link>https://dev.to/tommyy/block-chained-domains-handshake-decentralized-web-lof</link>
      <guid>https://dev.to/tommyy/block-chained-domains-handshake-decentralized-web-lof</guid>
      <description>&lt;p&gt;&lt;a href="https://handshake.org/"&gt;&lt;strong&gt;&lt;em&gt;Handshake&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; is a decentralized &lt;strong&gt;&lt;em&gt;P2P&lt;/em&gt;&lt;/strong&gt; (peer-to-peer) networking protocol.&lt;/p&gt;

&lt;p&gt;Differently from the classic DNS which relies on the &lt;a href="https://www.internetsociety.org/ianatimeline/"&gt;IANA&lt;/a&gt; database, Handshake uses the block chain to keep an immutable collection of addresses.&lt;/p&gt;

&lt;p&gt;Handshake is still in beta but growing rapidly among the internet community. &lt;/p&gt;

&lt;p&gt;As of &lt;em&gt;17 March 2022&lt;/em&gt;, &lt;a href="https://www.namecheap.com/domains/handshake-domains/"&gt;Namecheap&lt;/a&gt; is the only major domain reseller that lets you buy a handshake domain, with ease.&lt;/p&gt;

&lt;p&gt;Domains can be acquired through the auctioning system at &lt;a href="https://hsd-dev.org/guides/auctions.html"&gt;hsd-dev.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.namebase.io/"&gt;Namebase&lt;/a&gt; offers an auctioning platform.&lt;/p&gt;

&lt;p&gt;Go get your domain! &lt;/p&gt;

</description>
      <category>news</category>
      <category>webdev</category>
      <category>dns</category>
    </item>
    <item>
      <title>Linux V4L - Video Streaming 📹</title>
      <dc:creator>De</dc:creator>
      <pubDate>Fri, 18 Mar 2022 13:20:08 +0000</pubDate>
      <link>https://dev.to/tommyy/linux-v4l-video-streaming-pld</link>
      <guid>https://dev.to/tommyy/linux-v4l-video-streaming-pld</guid>
      <description>&lt;p&gt;From Wikipedia, &lt;strong&gt;&lt;em&gt;Video4Linux&lt;/em&gt;&lt;/strong&gt; (V4L for short) is a collection of device drivers and an API for supporting real-time video capture on Linux systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;V4L&lt;/em&gt;&lt;/strong&gt; (or it's successor &lt;strong&gt;&lt;em&gt;V4L2&lt;/em&gt;&lt;/strong&gt;) are used in many scenarios, such as applying effects to your stream.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Stream
&lt;/h2&gt;

&lt;p&gt;Load the &lt;strong&gt;V4L2&lt;/strong&gt; module first:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ modprobe v4l2loopback&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command above will create a virtual video device. &lt;br&gt;
To check the available video devices:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ v4l2-ctl --list-devices&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;A "&lt;em&gt;Dummy video device&lt;/em&gt;" should be available, for simplicity, we will call this device &lt;strong&gt;&lt;em&gt;/dev/video2&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Map the video stream:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ffmpeg -re -i VIDEO_NAME.mp4 -map 0:v -f v4l2 /dev/video2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I use &lt;a href="https://www.videolan.org/"&gt;VLC&lt;/a&gt; to play the video&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ vlc v4l2:///dev/video2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You can also stream from a URL, for example, to stream from an &lt;strong&gt;&lt;em&gt;.m3u8&lt;/em&gt;&lt;/strong&gt; playlist:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ffmpeg -i 'https://www.example.com/video/file.m3u8' -c copy -vcodec rawvideo -threads 0 -f v4l2 /dev/video2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The video can now be accessed in real-time from &lt;strong&gt;/dev/video2&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Also Youtube-dl can be used to obtain a HLS link to the &lt;strong&gt;&lt;em&gt;m3u8&lt;/em&gt;&lt;/strong&gt; playlist, just use the &lt;strong&gt;&lt;em&gt;-g&lt;/em&gt;&lt;/strong&gt; flag&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ youtube-dl -g https://www.youtube.com/watch?v=QquG9a8xpfk&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You can use &lt;a href="https://webcamtests.com/"&gt;webcamtests.com&lt;/a&gt; to see /dev/video2 from your browser.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SSH - A Better VPN 🚀</title>
      <dc:creator>De</dc:creator>
      <pubDate>Wed, 16 Mar 2022 19:21:11 +0000</pubDate>
      <link>https://dev.to/tommyy/ssh-a-better-vpn-2n30</link>
      <guid>https://dev.to/tommyy/ssh-a-better-vpn-2n30</guid>
      <description>&lt;p&gt;As alternative to &lt;strong&gt;&lt;em&gt;VPN&lt;/em&gt;&lt;/strong&gt;, a SOCKS5 tunnel is often a faster, cheaper alternative.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ssh USERNAME@IP -D PORT&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;In the following example, the &lt;strong&gt;&lt;em&gt;USERNAME&lt;/em&gt;&lt;/strong&gt; we use is &lt;strong&gt;&lt;em&gt;root&lt;/em&gt;&lt;/strong&gt;, the VPS &lt;strong&gt;&lt;em&gt;IP&lt;/em&gt;&lt;/strong&gt; is &lt;strong&gt;&lt;em&gt;23.84.52.11&lt;/em&gt;&lt;/strong&gt; and we want to create a SOCKS5 listening on &lt;strong&gt;&lt;em&gt;PORT&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;2240&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ssh root@23.84.52.11 -D 2240&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The SOCKS5 proxy should now be available.&lt;br&gt;
Adjust your browser settings accordingly; the proxy host will be &lt;em&gt;127.0.0.1&lt;/em&gt; or &lt;em&gt;localhost&lt;/em&gt; and the port &lt;em&gt;2240&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;127.0.0.1:2240&lt;/code&gt;&lt;br&gt;
or&lt;br&gt;
&lt;code&gt;localhost:2240&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, if you want to surf without a proxy, Tun2socks is a great tool you can use to tune a SOCKS proxy to a virtual interface.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Internet Everywhere - DNS Tunnel 🚇</title>
      <dc:creator>De</dc:creator>
      <pubDate>Wed, 16 Mar 2022 18:50:59 +0000</pubDate>
      <link>https://dev.to/tommyy/internet-everywhere-dns-tunnel-4cd3</link>
      <guid>https://dev.to/tommyy/internet-everywhere-dns-tunnel-4cd3</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;DNS Tunnel&lt;/em&gt;&lt;/strong&gt; is a great tool for accessing the internet even in the most unlikely places.&lt;/p&gt;

&lt;p&gt;At times, you may encounter a faulty internet connection, down for maintenance, filtered by a firewall;&lt;br&gt;
a DNS tunnel can connect you to the internet, and is quite simple to create one.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;p&gt;You need a &lt;a href="https://www.namecheap.com/" rel="noopener noreferrer"&gt;domain name&lt;/a&gt;, a &lt;a href="https://www.linode.com/" rel="noopener noreferrer"&gt;VPS&lt;/a&gt; and &lt;a href="https://code.kryo.se/iodine/" rel="noopener noreferrer"&gt;Iodine&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Iodine is the software we will use to tunnel internet data.&lt;/p&gt;
&lt;h2&gt;
  
  
  Install Iodine
&lt;/h2&gt;

&lt;p&gt;Install Iodine (hyperlink above) in both your server and your personal device, Iodine supports Android, Linux, and Windows.&lt;/p&gt;

&lt;p&gt;You may also use a package manager&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ apt install iodine&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;$ yum install iodine-server&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;$ pacman -Sy iodine&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up
&lt;/h2&gt;

&lt;p&gt;Access your domain registrar (eg. Namecheap or Godaddy) DNS dashboard: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a DNS record of &lt;strong&gt;&lt;em&gt;Type&lt;/em&gt;&lt;/strong&gt; "&lt;em&gt;A&lt;/em&gt;", with &lt;strong&gt;&lt;em&gt;Name&lt;/em&gt;&lt;/strong&gt; "&lt;em&gt;t1ns&lt;/em&gt;" and &lt;strong&gt;&lt;em&gt;Data/Value&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;YOUR_VPS_IP&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;where "YOUR_VPS_IP" is the actual IP of your VPS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a DNS record of &lt;strong&gt;&lt;em&gt;Type&lt;/em&gt;&lt;/strong&gt; "&lt;em&gt;NS&lt;/em&gt;", with &lt;strong&gt;&lt;em&gt;Name&lt;/em&gt;&lt;/strong&gt; "&lt;em&gt;t1&lt;/em&gt;" and &lt;strong&gt;&lt;em&gt;Data/Value&lt;/em&gt;&lt;/strong&gt; t1ns.&lt;em&gt;YOUR_DOMAIN&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;where "YOUR_DOMAIN" is the domain you acquired from step 1.&lt;br&gt;
The result should look similar to the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3jxnxmvxgdive4acu7k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3jxnxmvxgdive4acu7k.png" alt="DNS records preview"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Tunnel data
&lt;/h2&gt;

&lt;p&gt;Make sure the DNS records have propagated:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ nslookup t1ns.YOUR_DOMAIN&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command above should return your server IP.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ dig A t1.YOUR_DOMAIN&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command above should confirm the DNS record delegation.&lt;/p&gt;

&lt;p&gt;Let's create the tunnel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;strong&gt;&lt;em&gt;iodined&lt;/em&gt;&lt;/strong&gt; (note the "d") on your server
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$ iodined -f -P My_Super_Password 10.0.0.1 t1.YOUR_DOMAIN&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;the IP "&lt;em&gt;10.0.0.1&lt;/em&gt;" in the command above can be replaced with another free private reserved IP. You may leave it as it is.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;strong&gt;&lt;em&gt;iodine&lt;/em&gt;&lt;/strong&gt; on your device
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$ iodine -f -P My_Super_Password t1.YOUR_DOMAIN&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;the "&lt;strong&gt;&lt;em&gt;-f&lt;/em&gt;&lt;/strong&gt;" option instructs Iodine to run in foreground.&lt;/p&gt;

&lt;p&gt;You should be able to reach your server through &lt;em&gt;10.0.0.1&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Finally, you can establish an &lt;a href="https://dev.to/tommycnr/ssh-a-better-vpn-2n30"&gt;SSH SOCKS5&lt;/a&gt; proxy connection to your server, happy surfing.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ssh SERVER_USERNAME@10.0.0.1 -D PORT&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🐧 Linux - Identify CPU Intensive Processes</title>
      <dc:creator>De</dc:creator>
      <pubDate>Wed, 16 Mar 2022 18:46:51 +0000</pubDate>
      <link>https://dev.to/tommyy/linux-identify-cpu-intensive-process-1p67</link>
      <guid>https://dev.to/tommyy/linux-identify-cpu-intensive-process-1p67</guid>
      <description>&lt;p&gt;To list all the current processes, starting from the most CPU intensive&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ top -o %CPU&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Once you have identified the process, take not of the &lt;strong&gt;&lt;em&gt;PID&lt;/em&gt;&lt;/strong&gt; shown in the leftmost column.&lt;/p&gt;

&lt;p&gt;You should see something similar to the image below &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fub7vlrpsa8nbkkb3b5zl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fub7vlrpsa8nbkkb3b5zl.png" alt="top command result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our example, the &lt;strong&gt;bash&lt;/strong&gt; script with &lt;strong&gt;&lt;em&gt;PID 1435719&lt;/em&gt;&lt;/strong&gt; is consuming 100% CPU - out of 1 of 4 cores. &lt;em&gt;(see first entry of the image above)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The command &lt;strong&gt;&lt;em&gt;ps&lt;/em&gt;&lt;/strong&gt; displays information about a selection of the active processes.&lt;/p&gt;

&lt;p&gt;We can pipe &lt;strong&gt;&lt;em&gt;ps&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;grep&lt;/em&gt;&lt;/strong&gt; to obtain a clear-cut list &lt;br&gt;
of the processes we are looking for.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ ps aux | grep 1435719&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsno0bn66loq81tcfdz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsno0bn66loq81tcfdz3.png" alt="ps command result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;kill&lt;/em&gt;&lt;/strong&gt; command can be used to stop a process.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kill 1435719&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
