Skip to content

Instantly share code, notes, and snippets.

View mariotpc's full-sized avatar
🎯
Focusing

Mario Enrique Lopez Guzman mariotpc

🎯
Focusing
View GitHub Profile
[Unit]
Description=Dropbear SSH server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/sbin/dropbear -b /etc/dropbear/logo.txt
PIDFile=/var/run/dropbear.pid
[Install]
As the first step go to https://matt.ucc.asn.au/dropbear/dropbear.html
after locate Download section ( on the right side ) o click on the link https://matt.ucc.asn.au/dropbear/
Select the last one according to your year ( to me is "dropbear-2017.75.tar.bz2 2017-05-18 22:55 1.5M Link to releases directory instead" )
Tip: I copy the link with the right button over and get it using wget
Example:
wget https://matt.ucc.asn.au/dropbear/dropbear-2017.75.tar.bz2
uncompress the bzip2 using:
tar -jxvf dropbear-2017.75.tar.bz2
Install the NOOBS software to SD Card is as easy as to download the BOOBS zip and unzip to the root FS onto the SDCARD with vfat format.
Just, the SDCard must be at lest 8GB.
@mariotpc
mariotpc / celtofah.py
Created October 8, 2018 05:48
Nameko microservice RPC
from nameko.rpc import rpc
class FTHService:
name = "CelciusToFahrenheit"
@rpc
def convert (self, Celcius):
Fahrenheit = float(int(Celcius) * 1.8) + 32
return "Hello the Fahrenheit Temp is: , {}!".format(Fahrenheit)
class HiService:
@mariotpc
mariotpc / create a connection between serial console and bluetooth serial port
Last active August 17, 2020 01:12
create a connection between serial console and bluetooth serial port
first all the bluez apps must be updated
root@raspberrypi:/home/pi# vi /etc/systemd/system/dbus-org.bluez.service
add:
[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth
@mariotpc
mariotpc / Extract Firmware of my Nebula 1200AC
Created August 17, 2020 16:59
Extract Firmware of my Nebula 1200AC
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
64 0x40 xz compressed data
2162688 0x210000 Squashfs filesystem, little endian, version 4.0, compression:xz, size: 6502290 bytes, 2019 inodes, blocksize: 131072 bytes, created: 2018-06-06 07:02:05
9830400 0x960000 JFFS2 filesystem, little endian
dd if=tf_recovery.img of=header.bin bs=1 count=64 skip=0
dd if=tf_recovery.img of=xzdata.xz bs=1 count=2162624 skip=64
@mariotpc
mariotpc / Compile U-BOOT for raspberry pi B+
Last active August 20, 2020 19:41
Compile U-BOOT for raspberry pi B+
My Raspberry Pi B+ comes from 5 years ago, this was bought by me on my travel to Boston,
Fist all, you must have a GCC Cross Compiler, this could be the Linaro or some made by you using crosstool, as in my case.
Add your toolchain to your environment
PATH=${HOME}/x-tools/armv6-rpi-linux-gnueabi/bin/:$PATH
export CROSS_COMPILE=armv6-rpi-linux-gnueabi-
export ARCH=arm
[mariotpc@fedora31 u-boot]$ ls ~/x-tools/armv6-rpi-linux-gnueabi/
armv6-rpi-linux-gnueabi/ build.log.bz2 lib/ libexec/
@mariotpc
mariotpc / start the qemu with raspberry Pi+
Last active August 22, 2020 22:44
start the qemu with raspberry Pi+
[root@fedora rpi]# ls -ltr
total 10970300
-rw-r--r-- 1 root root 1566114915 Apr 10 2017 2017-04-10-raspbian-jessie.zip
-rw-r--r-- 1 root root 1149027370 Jun 20 2019 2019-06-20-raspbian-buster.zip
-rw-r--r-- 1 root root 452715448 May 27 20:01 raspios_lite_armhf_latest.190820.zip
-rw-r--r-- 1 root root 83803 Aug 19 13:55 kernel-qemu-4.19.50-buster
-rwxrwxrwx 1 root root 82044 Aug 19 13:55 versatile-pb-buster.dtb
-rw-r--r-- 1 root root 83259 Aug 19 13:55 versatile-pb.dtb
-rw-r--r-- 1 root root 2534200 Aug 19 15:33 kernel-qemu-3.10.25-wheezy
-rw-r--r-- 1 root root 3774873600 Aug 19 18:00 2019-06-20-raspbian-buster.img
@mariotpc
mariotpc / start u-boot in versatile express ARM
Last active August 20, 2020 19:40
start u-boot in versatile express ARM
first all,... compile it and get the u-boot binary executable
[mariotpc@fedora31 u-boot]$ make vexpress_ca9x4_defconfig CROSS_COMPILE=~/Downloads/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
@mariotpc
mariotpc / Compile Kernel 4.9.13 to use with QEmu and ARM target
Last active August 22, 2020 22:49
Compile Kernel 4.9.13 to use with QEmu and ARM target
First One, Download the kernel
************************************************************
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.13.tar.gz
uncompress it
************************************************************
tar -zxvf linux-4.9.13.tar.gz
going inside
************************************************************