<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Res Publica Non Dominetur - カルマン &#187; Linux</title>
	<atom:link href="http://karman.cc/blog/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://karman.cc/blog</link>
	<description>Lo público no tiene dominio.</description>
	<lastBuildDate>Sun, 29 Jun 2025 11:22:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DFP-34X-2C2 ZX279125 (ZTE Chipset) firmware Dump</title>
		<link>http://karman.cc/blog/archives/1058</link>
		<comments>http://karman.cc/blog/archives/1058#comments</comments>
		<pubDate>Thu, 20 Apr 2023 16:17:35 +0000</pubDate>
		<dc:creator>KaRMaN</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://karman.cc/blog/?p=1058</guid>
		<description><![CDATA[Available as a download here.
This is the mtd partition map:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00010000 &#8220;whole flash&#8221;
mtd1: 00040000 00010000 &#8220;uboot&#8221;
mtd2: 00130000 00010000 &#8220;kernel0&#8243;
mtd3: 00130000 00010000 &#8220;kernel1&#8243;
mtd4: 00010000 00010000 &#8220;others&#8221;
mtd5: 00010000 00010000 &#8220;parameter tags&#8221;
mtd6: 00060000 00010000 &#8220;usercfg&#8221;
mtd7: 00270000 00010000 &#8220;rootfs0&#8243;
mtd8: 00270000 00010000 &#8220;rootfs1&#8243;

Some hardware information:
/ # cat /proc/cpuinfo
Processor      [...]]]></description>
			<content:encoded><![CDATA[<p>Available as a download <a title="DFP-34X-2C2 firmware dump mtd0" href="http://karman.cc/blog/descargas/DFP-34X-2C2-mtd0.dd" target="_self">here</a>.</p>
<p>This is the mtd partition map:</p>
<blockquote>
<div id="_mcePaste"># cat /proc/mtd</div>
<div id="_mcePaste">dev:    size   erasesize  name</div>
<div id="_mcePaste">mtd0: 00800000 00010000 &#8220;whole flash&#8221;</div>
<div id="_mcePaste">mtd1: 00040000 00010000 &#8220;uboot&#8221;</div>
<div id="_mcePaste">mtd2: 00130000 00010000 &#8220;kernel0&#8243;</div>
<div id="_mcePaste">mtd3: 00130000 00010000 &#8220;kernel1&#8243;</div>
<div id="_mcePaste">mtd4: 00010000 00010000 &#8220;others&#8221;</div>
<div id="_mcePaste">mtd5: 00010000 00010000 &#8220;parameter tags&#8221;</div>
<div id="_mcePaste">mtd6: 00060000 00010000 &#8220;usercfg&#8221;</div>
<div id="_mcePaste">mtd7: 00270000 00010000 &#8220;rootfs0&#8243;</div>
<div id="_mcePaste">mtd8: 00270000 00010000 &#8220;rootfs1&#8243;</div>
</blockquote>
<p>Some hardware information:</p>
<blockquote><p>/ # cat /proc/cpuinfo<br />
Processor       : ARMv7 Processor rev 1 (v7l)<br />
BogoMIPS        : 1196.03<br />
Features        : swp half fastmult edsp<br />
CPU implementer : 0&#215;41<br />
CPU architecture: 7<br />
CPU variant     : 0&#215;4<br />
CPU part        : 0xc09<br />
CPU revision    : 1</p>
<p>Hardware        : ZX279125<br />
Revision        : 0020<br />
Serial          : 0000000000000000</p></blockquote>
<blockquote><p>/ # cat /proc/meminfo<br />
MemTotal:          21420 kB</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://karman.cc/blog/archives/1058/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DFP-34X-2C2</title>
		<link>http://karman.cc/blog/archives/975</link>
		<comments>http://karman.cc/blog/archives/975#comments</comments>
		<pubDate>Wed, 29 Jul 2020 15:23:48 +0000</pubDate>
		<dc:creator>KaRMaN</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://karman.cc/blog/?p=975</guid>
		<description><![CDATA[When I contracted my internet line with spanish ISP Pepephone they installed me a ZTE F680 router with embedded ONU/ONT. I didn&#8217;t wanted the router thing so I hacked it to achieve the ONU/ONT password and replaced with a classic ZTE F601.
Now I finally managed to get rid of the ZTE F601 by using a [...]]]></description>
			<content:encoded><![CDATA[<p>When I contracted my internet line with spanish ISP Pepephone they installed me a <a title="ZTE F680 hack" href="http://karman.cc/blog/archives/914" target="_blank">ZTE F680</a> router with embedded ONU/ONT. I didn&#8217;t wanted the router thing so I hacked it to achieve the ONU/ONT password and replaced with a classic ZTE F601.</p>
<p>Now I finally managed to get rid of the ZTE F601 by using a SFP with integrated ONU/ONT. The SFP I bought is DFP-34X-2C2 but DFP-34G-2C2 model should work as well.</p>
<div id="attachment_976" class="wp-caption aligncenter" style="width: 310px"><a href="http://karman.cc/blog/descargas/DFP-34G-2C2.png" rel="lightbox"><img class="size-medium wp-image-976" title=" DFP-34G-2C2 SFP ONU ONT" src="http://karman.cc/blog/descargas/DFP-34G-2C2-300x262.png" alt=" DFP-34G-2C2 SFP ONU ONT" width="300" height="262" /></a><p class="wp-caption-text"> DFP-34G-2C2 SFP ONU/ONT</p></div>
<p>This is an ARM v7 (ZX279125) running at 600Mhz and nearly 1200 bogomips, 32Mb integrated RAM and 16Mb of external (SPI?) flash (<a href="https://forum.mikrotik.com/viewtopic.php?t=116364&amp;start=300#p771961" target="_blank">source</a>) running linux ZTE flavour 2.6.32 in a SFP form factor. <a href="http://karman.cc/blog/descargas/GPONSTICKSFPCLASSB-2B_Rev01.pdf" target="_blank">PDF</a></p>
<p>To be able to configure it there has to be some link in the optical connection, otherwise the SFP interface in your switch/router might not linkup and the SFP internal IP might not be reachable.</p>
<p>The default connection info is as follows:</p>
<ul>
<li>IP: 192.168.1.1</li>
<li>VLAN: 1</li>
<li>URL: http://192.168.1.1</li>
<li>User: admin</li>
<li>Pass: admin</li>
</ul>
<p>In its web page you can configure PON settings and even routing mode. By default, there is no WAN connection (this means there&#8217;s no routing mode, only bridge with all vlans through the SFP interface port). You can make the SFP a router to route you house/office traffic by making a WAN connection but I prefer to keep it as bridge.</p>
<p>Once in the web configuration page we can configure LOID, SN and their passwords as per our ISP requirements:</p>
<div id="attachment_977" class="wp-caption aligncenter" style="width: 310px"><a href="http://karman.cc/blog/descargas/DFP-34G-2C2-LOID.png" rel="lightbox"><img class="size-medium wp-image-977" title="DFP-34G-2C2 LOID web" src="http://karman.cc/blog/descargas/DFP-34G-2C2-LOID-300x197.png" alt="DFP-34G-2C2 LOID web onu ont" width="300" height="197" /></a><p class="wp-caption-text">DFP-34G-2C2 LOID web</p></div>
<div id="attachment_978" class="wp-caption aligncenter" style="width: 310px"><a href="http://karman.cc/blog/descargas/DFP-34G-2C2-SN.png" rel="lightbox"><img class="size-medium wp-image-978" title="DFP-34G-2C2 SN web" src="http://karman.cc/blog/descargas/DFP-34G-2C2-SN-300x194.png" alt="DFP-34G-2C2 SN web" width="300" height="194" /></a><p class="wp-caption-text">DFP-34G-2C2 SN web</p></div>
<p>There is also telnet access with the following credentials:</p>
<ul>
<li>User: root</li>
<li>Pass: Pon521</li>
</ul>
<p>Telnet access is for linux advanced users and is not recomended to tamper with.</p>
<p>I bougth mine here: <a href="https://es.aliexpress.com/item/4000296796422.html" target="_blank">https://es.aliexpress.com/item/4000296796422.htm</a><a href="https://es.aliexpress.com/item/4000296796422.html">l</a></p>
<p>I have this SFP directly plugged to my C2960G switch and my router is a Debian virtual machine inside a synology DS218+ NAS which receivec VLAN20 traffic from the ONU/ONT through the switch and then the VM routers the traffic to VLAN1.</p>
]]></content:encoded>
			<wfw:commentRss>http://karman.cc/blog/archives/975/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>IoT cheap WiFi Button w/ LED</title>
		<link>http://karman.cc/blog/archives/945</link>
		<comments>http://karman.cc/blog/archives/945#comments</comments>
		<pubDate>Thu, 11 Jan 2018 17:28:09 +0000</pubDate>
		<dc:creator>KaRMaN</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sin categoria]]></category>

		<guid isPermaLink="false">http://karman.cc/blog/?p=945</guid>
		<description><![CDATA[
This is a simple-one-afternoot project that I made to be able to open the office door.
Our office door is locked by a presence control (with fingerprint reader, keypad and NFC cards) which is connected to a cloud server and API service. So, to open the door with just a button I need two curl calls [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>This is a simple-one-afternoot project that I made to be able to open the office door.</p>
<p>Our office door is locked by a presence control (with fingerprint reader, keypad and NFC cards) which is connected to a cloud server and API service. So, to open the door with just a button I need two curl calls to the API service in that server (one for login and another for opening the door).</p>
<p><a href="https://community.onion.io/assets/uploads/files/1514989577788-boton1.jpg" target="_blank" rel="lightbox"><img src="https://community.onion.io/assets/uploads/files/1514989577788-boton1-resized.jpg" alt="0_1514989447520_Boton1.JPG" /></a></p>
<p>I love using Omega2 over other projects because has 3 mainly things: has easy built-in wifi, is linux and is cheaper than other things like arduino. Also it&#8217;s footprint is quite small.</p>
<p><a href="https://community.onion.io/assets/uploads/files/1514989979543-6668df6d-df7a-4acf-8f65-b14f67c8cfe2-image.png" target="_blank" rel="lightbox"><img src="https://community.onion.io/assets/uploads/files/1514989979543-6668df6d-df7a-4acf-8f65-b14f67c8cfe2-image.png" alt="0_1514989849280_6668df6d-df7a-4acf-8f65-b14f67c8cfe2-image.png" /></a></p>
<p>For the button, I searched over some sites looking for a big button with small footprint but was a futile search. I ended for a chinese repurposed button. This one had a speaker and said &#8216;Yes&#8217; when pushed&#8217;.</p>
<p><a href="https://community.onion.io/assets/uploads/files/1514989688812-boton2.jpg" target="_blank" rel="lightbox"><img src="https://community.onion.io/assets/uploads/files/1514989688812-boton2-resized.jpg" alt="0_1514989558431_Boton2.JPG" /></a></p>
<p>I tore it down to fit inside the Omega2 main board, a small DC-DC step down 5v to 3.3v and a micro-usb connector for power. Also I put a small red led to show opening status. I reused the momentary switch soldering a pull-down resistors. Switch is on GPIO 17 and LED on GPIO 11.</p>
<p>Once everything is fit together comes time for a small code. I have 2 scripts. This one is a loop to read the gpio button:</p>
<pre><code>#!/bin/sh

# Boton (Input)
fast-gpio set-input 17 &gt; /dev/null 2&gt;&amp;1

# LED (Output)
fast-gpio set-output 11 &gt; /dev/null 2&gt;&amp;1
fast-gpio set 11 0 &gt; /dev/null 2&gt;&amp;1

# Bogus GPIO?
gpioctl dirout-low 16 &gt; /dev/null 2&gt;&amp;1

while [ 1 ]; do

        # Get button status
        STATUS=`fast-gpio read 17|awk '{print $4}'`

        if [ $STATUS -eq 1 ]; then
                fast-gpio set 11 1  &gt; /dev/null 2&gt;&amp;1
                # LED is light meanwhile the script 'open.sh' is being executed
                /root/open.sh
                fast-gpio set 11 0 &gt; /dev/null 2&gt;&amp;1
        fi

        # Some sleep
        sleep 0.05
done
</code></pre>
<p>The other one has the 2 curl sentences:</p>
<pre><code>#!/bin/sh
# Do login and save the cookie
curl -i -c cookie_door \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name": "someUser","password": "somePassword","user_id": "700"}' \
"https://api.biostar2.com/v1/login" &gt; /dev/null 2&gt;&amp;1</code></pre>
<pre><code>
# Use the cookie to open the door (index 1)
curl -i -b cookie_door \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"door_id": "1"}' \
"https://api.biostar2.com/v1/doors/1/open" &gt; /dev/null 2&gt;&amp;1
</code></pre>
<p>As a side comment about the &#8216;bogus GPIO&#8217;, I don&#8217;t get quite how works the GPIO in Omega2. Seems that GPIO 17 and 16 are somehow linked? I had to put 16 on dirout-low so 17 could work great.</p>
<p>Also I had to install GNU/sleep that accepts times &lt;1s. This way doesn&#8217;t use too much CPU without having to sleep 1s that could cause missing push to the push button.</p>
<p>In the end the project is highly usable for almost everything as is a simple network enabled IoT button. Changing the &#8216;<a rel="nofollow" href="http://open.sh/">open.sh</a>&#8216; script can make this project to use in a infinity uses.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://karman.cc/blog/archives/945/feed</wfw:commentRss>
		<slash:comments>521</slash:comments>
		</item>
		<item>
		<title>ZTE680 Hardware V4.0 (V2?) Hack</title>
		<link>http://karman.cc/blog/archives/914</link>
		<comments>http://karman.cc/blog/archives/914#comments</comments>
		<pubDate>Sun, 20 Aug 2017 14:36:40 +0000</pubDate>
		<dc:creator>KaRMaN</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[f680]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[jazztel]]></category>
		<category><![CDATA[masmovil]]></category>
		<category><![CDATA[pepephone]]></category>
		<category><![CDATA[zte]]></category>

		<guid isPermaLink="false">http://karman.cc/blog/?p=914</guid>
		<description><![CDATA[I just got recently installed my first FTTH router (pepephone, but same model is used in masmovil and jazztel) and as any network engineer I wanted to have full access to the router. Looking over the vast internet I found a blogpost that used a USB with a symlink to smb.conf so it can be [...]]]></description>
			<content:encoded><![CDATA[<p>I just got recently installed my first FTTH router (pepephone, but same model is used in masmovil and jazztel) and as any network engineer I wanted to have full access to the router. Looking over the vast internet I found a <a href="https://blog.eth1.es/2017/02/18/desbloqueando-el-router-zte-f680/">blogpost</a> that used a USB with a symlink to smb.conf so it can be edited to add exec parameters to execute an downloaded busybox to open an alternative telnetd but the article had a big problem that make it imposible to work on my router: the F680 of the article has an ARM architecture. My router has MIPS instead. This is important to know beforehand if using external-downloaded busybox binaries. In the end I skipped the busybox hack to directly allow admin telnet connection instead the buggy limited one. This is how I did it, I will assume that router has IP address 192.168.1.1.</p>
<p><span id="more-914"></span></p>
<ol>
<li>Using any windows, format any pen-drive in NTFS.</li>
<li>Using any linux, mount the NTFS formated pen-drive, change directory to the mounted path and do the following symlink:<br />
<blockquote><p>ln -s /var/samba/lib/smb.conf .</p></blockquote>
</li>
<li>Plug the pen-drive in the router. Ensure <strong>Samba Service</strong> is enabled.</li>
<li>Connect to <strong>\\192.168.1.1</strong>. This is a tricky part because the router only has SMBv1 which has been disabled since the WannaCry mess. I used my mac to connect to <strong>smb://samba@192.168.1.1/samba</strong>.</li>
<li>If ecerything is going fine you will see the smb.conf file in the connected shared. This part is tricky too because in windows you can only edit it with notepad++. In mac textedit and vi failed both to properly edit the file so I ended doing the following:<br />
<blockquote>
<pre>echo "[global]
  guest account = root
  deadtime = 5
  log level = 0
  server string = Samba Server
  security = share
  load printers = no
  workgroup = workgroup
  short preserve case = yes
  preserve case = yes
  netbios name = smbshare
[samba]
  comment = samba share dir
  read only = no
  guest ok = yes
  guest only = yes
  short preserve case = yes
  preserve case = yes
  max connections = 3
  path = /mnt
[root]
  exec = sendcmd 1 DB set TelnetCfg 0 UserTypeFlag 0; sendcmd 1 DB save
  comment = samba share root
  read only = no
  guest ok = yes
  guest only = yes
  short preserve case = yes
  preserve case = yes
  max connections = 3
  path = /" &gt; /Volumes/samba/usb1_1/smb.conf</pre>
</blockquote>
<p>This router version only has one USB so the path &#8216;usb1_1&#8242; should be fine. The differences between the original file and this version are the guest account = root and the root share, which includes a exec to change telnet behaviour. Actually the root share is just to mess with root file system but not really needed.</li>
<li>Without disconnecting the actual share or rebooting the router (changes will be lost!) open a new connection to the router (shares samba or root will be fine).</li>
<li>Now the telnet should be in admin mode. Try connecting to 192.168.1.1:23 with username <strong>root</strong> and password <strong>Zte521</strong>. Congratulation! you should now have an unlimited telnet inside the router.</li>
<li>To be able to connect as admin in the web interface do a <strong>sendcmd 1 DB p DevAuthInfo</strong> in the telnet session and search for the admin password. The admin password is a pre-router generated password so is unique to your router.</li>
</ol>
<p>I also wanted to do a full unencrypted dump of the configuration so in the telnet terminal do the following:</p>
<blockquote><p>for i in `sendcmd 1 DB p | awk &#8216;{print $2}&#8217;`; do echo $i; sendcmd 1 DB p $i; done</p></blockquote>
<p>Prepare for a extensive dump of data.</p>
<p>Also you can download a precompiled <a href="https://busybox.net/downloads/binaries/1.21.1/busybox-mipsel">busybox-mips</a> and win some commands as vi, uname and netstat.</p>
]]></content:encoded>
			<wfw:commentRss>http://karman.cc/blog/archives/914/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Editando una imagen initrd a pelo</title>
		<link>http://karman.cc/blog/archives/619</link>
		<comments>http://karman.cc/blog/archives/619#comments</comments>
		<pubDate>Tue, 28 Sep 2010 15:46:38 +0000</pubDate>
		<dc:creator>KaRMaN</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://karman.cc/blog/?p=619</guid>
		<description><![CDATA[En realidad es muy sencillo y generalmente conocido comprimir y descomprimir un árbol de archivos para editar por ejemplo las opciones del arranque del init y demás, esta entrada es mas a titulo personal para recordarlo en un futuro. Para descomprimir:
cp initrd.img initrd.gz
gunzip &#60; initrd.img &#124; cpio -i &#8211;make-directories
y para comprimir:
find ./ &#124; cpio -H [...]]]></description>
			<content:encoded><![CDATA[<p>En realidad es muy sencillo y generalmente conocido comprimir y descomprimir un árbol de archivos para editar por ejemplo las opciones del arranque del init y demás, esta entrada es mas a titulo personal para recordarlo en un futuro. Para descomprimir:</p>
<blockquote><p>cp initrd.img initrd.gz<br />
gunzip &lt; initrd.img | cpio -i &#8211;make-directories</p></blockquote>
<p>y para comprimir:</p>
<blockquote><p>find ./ | cpio -H newc -o &gt; initrd.cpio<br />
gzip initrd.cpio<br />
mv initrd.cpio.gz initrd.img</p></blockquote>
<p>Así de sencillo!</p>
]]></content:encoded>
			<wfw:commentRss>http://karman.cc/blog/archives/619/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
