almost-a-technocrat
almost-a-technocrat
almost-a-technocrat
178 posts
Don't wanna be here? Send us removal request.
almost-a-technocrat · 5 years ago
Link
This is my Windows batch code to generate all the necessary SSL certificates for Mosquitto MQTT TLS security. This batch code will run unattended and it is recommended that you make your necessary adjustment to the code below. I wrote this windows batch code based on  Mosquitto SSL Configuration -MQTT TLS Security. Please refer to the guide for more information on how to set up MQTT TLS with Mosquitto.
-----Code starts-----
@echo off
echo Creating a key pair (ca.key) for Certificate Authority (CA).
openssl genrsa -des3 -passout pass:123456 -out ca.key 2048
echo Creating a CA Certificate (ca.crt) and signing it with ca.key.
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt -passin pass:123456 -subj "/C=US/ST=New York/L=Staten/O=dreamcatcher/OU=RnD/CN=192.168.0.104"
echo Creating a Broker key pair (broker.key).
openssl genrsa -out broker.key 2048
echo Creating a Broker certificate request file (broker.csr) and signing it with broker.key.
openssl req -new -out broker.csr -key broker.key -subj "/C=US/ST=New York/L=Manhattan/O=dreamcatcher/OU=Marketing/CN=192.168.0.104"
echo Signing the Broker certificate with the CA certificate (ca.crt)
openssl x509 -req -in broker.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out broker.crt -days 720 -passin pass:123456
echo Moving all created files to a MQTT_TLS_Certs folder
mkdir MQTT_TLS_Certs
move *.crt MQTT_TLS_Certs
move *.key MQTT_TLS_Certs
move *.csr MQTT_TLS_Certs
move *.srl MQTT_TLS_Certs
echo port 8883 > MQTT_TLS_Certs\broker.conf
echo cafile C:\Program Files\mosquitto\MQTT_TLS_Certs\ca.crt >> MQTT_TLS_Certs\broker.conf
echo keyfile C:\Program Files\mosquitto\MQTT_TLS_Certs\broker.key >> MQTT_TLS_Certs\broker.conf
echo certfile C:\Program Files\mosquitto\MQTT_TLS_Certs\broker.crt >> MQTT_TLS_Certs\broker.conf
echo tls_version tlsv1.2 >> MQTT_TLS_Certs\broker.conf
-----Code Ends-----
To start Mosquitto broker/server on Windows: mosquitto.exe -c MQTT_TLS_Certs\broker.conf -v To start Mosquitto subscriber on Windows: mosquitto_sub.exe -h IPADDRESS -t /SensorData --cafile MQTT_TLS_Certs\ca.crt -p 8883 To use Mosquitto to publish a message to broker: mosquitto_pub.exe -h IPADDRESS -t /SensorData --cafile MQTT_TLS_Certs\ca.crt -p 8883 -m “hello world”
(via https://ift.tt/2wWe5t1 )
0 notes
almost-a-technocrat · 6 years ago
Link
If you are working with Raspberry Pi or any other Linux systems and you want to protect how you set up the board, you can use this method to remove the record of custom packages that you have installed. It will make it harder for people to reverse engineer your setup. 
They can still clone your SD card and use it on other RPi boards. For that, you can refer to How to prevent Raspberry Pi SD card cloning blog post.
Open /var/lib/dpkg/status file with a text editor. Find a block that belongs to the software package you want to remove and it looks something like this:
Package: xserver-xorg-input-vmmouse Status: install ok installed Priority: optional Section: x11 Installed-Size: 136 Maintainer: Ubuntu Developers <[email protected]> Architecture: amd64 Version: 1:12.7.0-2 Provides: xorg-driver-input Depends: libc6 (>= 2.7), xorg-input-abi-12, xserver-xorg-core (>= 2:1.10.0-0ubuntu1~), xserver-xorg-input-mouse, udev Description: X.Org X server -- VMMouse input driver to use with VMWare This package provides the driver for the X11 vmmouse input device. . The VMMouse driver enables support for the special VMMouse protocol that is provided by VMware virtual machines to give absolute pointer positioning. . The vmmouse driver is capable of falling back to the standard "mouse" driver if a VMware virtual machine is not detected. This allows for dual-booting of an operating system from a virtual machine to real hardware without having to edit xorg.conf every time. . More information about X.Org can be found at: <URL:http://www.X.org> . This package is built from the X.org xf86-input-vmmouse driver module. Original-Maintainer: Debian X Strike Force <[email protected]>
Remove the whole block and you will remove the installation record of that package. The package will no longer appear to be installed to dpkg; despite all the files still available.
(via http://bit.ly/2It23KS )
0 notes
almost-a-technocrat · 6 years ago
Link
A simple script to prevent Raspberry Pi micro SD card cloning. It uses the CPU serial number as the unique ID for authentication. Use this script during boot up to check if the Raspberry Pi CPU serial number matches with the number hardcoded in the script. If the number does not match, then it will shut down Raspberry Pi. ----------------------script start------------------- #!/bin/bash cpuserial=`cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2` match=0 listofcpuserial=("000000004d754df1" "000000004d754df2" "000000004d754df3") for i in "${listofcpuserial[@]}" do   if [ $i = $cpuserial ]   then     match=1   fi done if [ $match = 1 ] then   echo "Sound Card State Restored" else   echo "Sound Card State Not Restored"   sudo halt -p fi -----------------script end---------------------- This script is just one part of the whole SD card cloning prevention. Next, you will need to compile this script into binary. By compiling this script into a binary program file, the file cannot be read by just using a text editor. To compile it into a binary program file;
shc -f ./script.sh
Note: you need to install shc first into your Raspberry Pi. Run this command:
sudo apt-get install shc
After compiling the script, name the binary program file into something less suspecting. After renaming, move the program to /lib/bin or /bin or any other locations that usually programs are located. The idea is to hide it there and blend it with the other programs. The final step is to start the program during startup. There are many ways to start the program during startup. Refer to this link to choose your poison: https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup My recommendation is to hide your startup command within any existing startup script that the Raspberry Pi would have. This way it makes it hard to find it. Don't forget to delete any script left in the system. You don't want the source to be discovered. (via http://bit.ly/2P06FcI )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
My Garmin eTrex20 is now about 6 years since I bought it. Since then I have using it and some times under utilizing it. But when time pass all things and materials will start to degrade. The buttons on the Garmin eTrex 20 have now disintegrated. Turned to rubber dust! The replacement casing is quite expensive and I found a cheaper way to fix it. However it will not be water proof anymore. Never the less I could still use it. These are how the disintegrated buttons look like.
Tumblr media Tumblr media
Prepare these stuffs.
Tumblr media Tumblr media Tumblr media
Cut the eraser into smaller pieces.
Tumblr media
Measure the size of the eraser to cut by inserting it into the button holes.
Tumblr media Tumblr media
After you have got the right size, make 4 more of them.
Tumblr media
You should be able to press the button once all the cut erasers are in place.
Tumblr media Tumblr media Tumblr media
Use duct tape to cover them.
Tumblr media Tumblr media Tumblr media Tumblr media
These are rubber bumpers you can buy from Ailiexpress. I bought it from: https://ift.tt/2DrOTv4 It also comes with free screen protector.
Tumblr media
Fix the rubber bumpers on the Garmin eTrex 20 and the device is good to go.
Tumblr media
(via https://ift.tt/2Q1TTNz )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
This SKMEI 1418 / 1427 digital watch is a great outdoor watch for a really cheap price. However, the instructions manual is far from good. It took me some time to explore some of the functions and at the same time trying to understand the instructions manual provided by SKMEI. I decided to write an alternative instructions manual for this watch so that other owners of this watch might benefit from it. But never the less, I am not a good English language writer myself. But I do think it is still better than the instructions manual provided. Feel free to correct me using the comment section.
A better alternative SKMEI 1418 / 1427 instructions manual
(via https://ift.tt/2Q1cABb )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
SKMEI 1418 / 1427 has five buttons that perform various functions depends on the mode or screen it is in. For example on the main screen, the dedicated barometer button is to switch the mode to barometer mode from the main screen. When in the setting mode, the same button performs as an up button or when in stopwatch mode, the same button is the start button. Keep reading to learn how to navigate through the watch modes from the main screen.
Switching the watch screens
1.    From the main screen, press the MODE button to cycle the watch screens for different types of functions:
Main screen (Time and date) --> STEP (Pedometer) --> REC (Pedometer history) --> ALM (Alarm) --> CHR (Stopwatch/Chronometer) --> TMR (Countdown timer) --> PACER --> T2 (2nd time zone)
2.    From the main screen, press the BAROmeter button to go to the digital barometer screen. Press the MODE button to go back to the main screen.
3.    From the main screen, press the COMPass button to go to the digital compass screen. Press the MODE button to go back to the main screen.
4.    From the main screen, press the ALTImeter button to go to the altimeter screen. Press the MODE button to go back to the main screen.
Setting mode
1.    From the main screen, press and hold the MODE button to enter the watch setting screen.
2.    Press the MODE button to cycle the settings:
Seconds --> Minute --> Hour --> Year --> Month --> Date --> Date and month display format --> 12/24 hr format --> LCD brightness --> button beep --> weather forecast display
3.    For each setting, press the UP or DOWN button to change it.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2DrzL0L )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
SKMEI 1418 / 1427 barometer mode displays the current air pressure and current temperature measurement. It also stores a history of air pressure measurement for 24 hours with one measurement per hour. Keep reading to find out how to set it up, calibrate and use it.
Buttons and main screen layout
Tumblr media
Setting mode
1.    From the main screen, press the dedicated BAROmeter button to enter barometer mode.
2.    Press and hold the MODE button to enter barometer-setting mode.
In the setting mode, you can cycle through three types of settings for barometer mode using the MODE button.
AIRP CAL --> TEMP CAL --> F.DEF CAL
AIRP CAL = Air pressure calibration
TEMP CAL = Temperature calibration
F.DEF CAL = Reset to default factory settings
Air pressure calibration
1.    Cycle to AIRP CAL screen and press either the UP or DOWN button to increase or decrease your customized air pressure value.
2.    Press and hold the MODE button to apply your change.
Temperature calibration
1.    Cycle to TEMP CAL screen and press either the UP or DOWN button to increase or decrease your customized temperature value.
2.    Press and hold the MODE button to apply your change.
Reset to default factory settings
1.    Cycle to F.DEF CAL screen and press either the UP or DOWN button to select yes or no.
2.    Press and hold the MODE button to apply your selection.
Changing the top display
While in barometer mode screen, press the BAROmeter button to cycle the top display to show different information.
Temperature --> Averaged air pressure --> Air pressure history graph
The air pressures’ history graph is showing air pressure measured every hour automatically in the background.
Viewing air pressure history
1.    While in barometer mode screen, press the BAROmeter button to cycle the top display to show the air pressures’ history graph.
2.    Press the DOWN button to immediately showing the air pressure measurement of the last hour.
3.    Keep pressing the DOWN button to cycle back in time hour by hour to show the air pressure measurement of each hour.
The watch will keep a history of 12 hours of measurements. While cycling through the history, notice the flashing of the air pressures’ history graph, which indicates how far back of the history you are looking at.
Changing the air pressure and temperature measurement unit
While in the barometer mode screen and the top display is showing temperature, press and hold the BAROmeter button to cycle the combinations of air pressure and temperature measurement unit.
degC, hpa/mb --> degC, inHg --> degF, hpa/mb --> degF, inHg
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2Q1CEfu )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
This SKMEI 1418 / 1427 stopwatch function is represented as CHR which I believe it is short for the chronograph. The operation is pretty straightforward and similar to other watches with the Start and Reset buttons are printed on the watch.
Buttons and main screen layout
Tumblr media
Starting and stopping the stopwatch
1.    Press the START button to start or stop the stopwatch.
2.    When the stopwatch stopped, press and hold the RESET button to reset it.
Timing laps
1.    While the stopwatch is running, press the RESET button to record the lap time. It can hold up to 99 laps time.
2.    To view the lap times after the stopwatch stopped, press and hold the MODE button.
3.    Press UP or DOWN button to view each lap time.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2DrfBUG )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
This is a step pacing function. It creates beeping sounds for you to keep the rhythm of your run. The main display the total beeps and the bottom display the frequency of the beeps in beeps per minute (bpm). I remember that this function was in one of the Casio running watch before the year 2000. It helps to pace your steps to make sure that your running speed is not slower and meet your target completion time during training. But I never remember this was a popular function during that time.
Buttons and main screen layout
Tumblr media
Starting and stopping the pacer
1.    Press the START button to start the pacer.
2.    Press the START button to stop the pacer.
3.    Press and hold the RESET button to rest the pacer count.
Changing the pacer beeping frequency
1.    Press and hold the MODE button to enter the setting mode to change the frequency of the pacer beeps. The frequency is display at the bottom as beeps per minute.
2.    Once in the setting mode, you can press the UP or DOWN button to increase or decrease the frequency.
3.    You can even start the pacer and enter into the setting mode to change the frequency while listening to the beeping sound.
4.    Press and hold the MODE button to apply the selected frequency.
SKMEI 1418 /1427 other contents
(via https://ift.tt/2PYqXGv )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
SKMEI 1418 / 1427 has two alarms that can be set up separately. In this mode, you can turn on and off the hourly chime mode.
Buttons and main screen layout
Tumblr media
Selecting alarm 1 or alarm 2 and Turning the hourly chime on or off
1.    Press the UP button to select alarm 1 (ALM1) or alarm 2 (ALM2).
2.    Press the UP button the 3rd time you can turn the watch hourly chime on or off.
Turning alarm on or off
At either alarm 1 or 2 screen, press the DOWN button to turn on or off the alarm.
Setting the alarm time
1.    Press and hold the MODE button until the minute start flashing.
2.    Press the MODE button to select either the hour or minute to change.
3.    Press the UP or DOWN button to change it.
4.    Press and hold the MODE button to apply the setting.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2Dr3Qxr )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
The SKMEI 1418 / 1427 timer can be set up to 24 hours of countdown. The countdown timer operation is similar to other watches and it should not be complicated to operate.
Buttons and main screen layout
Tumblr media
Starting and stopping the countdown timer
1.    Press the START button to start or stop the timer.
2.    Press the RESET button to reset the timer.
Setting the countdown time
1.    Press and hold the MODE button until the hour start flashing.
2.    Press the MODE button to select hour or minute or seconds to set.
3.    Press the UP or DOWN button to change it.
4.    Press and hold the MODE button to apply the setting.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2Q3elxP )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
SKMEI 1418 / 1427 does not have an extensive world time zones like my Casio SGW300HD-1AV or Casio AE-1200WHD. It only has one time zone that you can set whenever you reach another country with different time zone. I think it is enough for most people who will only travel to one country at a time unless you are a globetrotter that visits multiple countries in one go.
Buttons and main screen layout
Tumblr media
Setting the 2nd time zone time
1.    Press and hold the MODE button to enter the setting mode.
2.    Press MODE button to select hour or minute.
3.    Press UP or DOWN button to increase or decrease.
4.    Press and hold the MODE button to apply the setting.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2Dq8Tyg )
0 notes
almost-a-technocrat · 6 years ago
Link
Tumblr media
I was rather surprised that SKMEI is able to squeeze a step counter into this watch. As this watch does not have a Bluetooth link to a smartphone for workout tracking, the step counter can only be used to track workout and store the workout data in the phone for seven days. Although it does not have the smartphone link to do a full workout analysis, but I found it enough to get an estimate of distance and calories I burned for my workout. At least I don't have to charge this watch every day.
Buttons and main screen layout
Tumblr media
Changing the pedometer display
Press the UP button to cycle the display.
Step --> KM --> KCAL --> TIMER
Step = Number of steps counted or detected by the watch pedometer.
KM = Estimated distance in kilometer. The estimation calculated based on the stride length setting and the total number of steps counted.
KCAL = Estimated calories burned. The estimation calculated based on the body weight setting.
Timer = Total active time. It will only run when there is activity.
Setting mode
1.    Press and hold the MODE button to enter the setting mode of the pedometer.
2.    Press the MODE button to cycle the types of setting. At any setting, press UP or DOWN button to change it.
Unit of measurement --> Stride length --> Bodyweight
Unit of measurement = Change the unit of measurement between Metric or Imperial units. Metric units presented as KM and Imperial units presented as INCH. The change will change the pedometer displays and the settings displays.
Stride length = Change the length of a single step. This is used to calculate the distance.
Body weight = Change the body weight. This is used to calculate the calories burned.
Starting and stopping the pedometer
1.    To start the pedometer, press and hold the DOWN button until you see a small running man icon flashing at the bottom of the watch display. The pedometer is running in the background. You can still use other functions of the watch while the pedometer is running.
2.    To stop the pedometer, press and hold the DOWN button until you see the small running man icon disappear.
Viewing the pedometer history
1.    From the pedometer screen, press the MODE button to enter the pedometer history screen (REC).
2.    Press DOWN button to view the pedometer history of the last 7 days. At the bottom of the display is the history date.
3.    At each of the history day, press the UP button to view the distance, calories burned and total active time.
SKMEI 1418 / 1427 other contents
(via https://ift.tt/2Q1FrVV )
0 notes
almost-a-technocrat · 6 years ago
Link
I bought this watch four months ago and I have been wearing it every week during my weekend hiking. Overall this watch is impressive considering the number of features per the price that I have paid for it. All the features worked flawlessly considering that this is a relatively cheap watch comparing it to Casio ProTrek range of watch. SKMEI 1358 is basically an equivalent of Casio's triple sensors watches. You might know them as Pro Trek or Pathfinder in North America. It has a barometer, a thermometer, and a digital compass. It also has an extra sensor that the Pro Trek watches might not have as far as I know of. It has a pedometer. Yes, it counts steps and estimates the calories burnt and distance traveled. With the combination of these sensors, this is an ideal outdoor watch you can have for a fraction of a Casio Pro Trek price.
Tumblr media
SKMEI 1358
Dimensions
Tumblr media
SKMEI 1358 Watch Dimensions
Quality and Durability
After four months of usage, I felt that the quality of the watch is acceptable. The watch is built like a G-Shock but I doubt that it would match up with G-Shock. Never the less the G-Shock look-alike built does provide good protection against drop or accidental knocks to walls. However, it can only withstand 30m of water resistant. I suspect that the lower limit of water resistant is caused by how they positioned the pressure sensor. Don't expect that this watch can withstand the force of a car wheel rolling on it. Some Youtube videos demonstrate that a G-Shock will survive such a test.
Tumblr media
SKMEI 1358 Pressure Sensor Position
The wristband provided is surprisingly good silicone band. I notice that SKMEI uses unconventional pins to hold the wristband to the watch. The design of the wristband and its pins from my point of view is genius. The tighter you wear the watch, the tighter the wristband is attached to the watch. It also very easy to disassemble the wristband from the watch. However, after four months of wearing with my sweat pouring over the watch, the pins started to rust. It seems that SKMEI decided to use non-stainless steel pins. Such a pity. It's almost perfect. Treating the pins with WD-40 seems to prevent rusting.
Tumblr media
Notice the side pins begin to rust
Tumblr media
Rust mark after a side pin was taken out
Tumblr media
Rusted side pins
User Experience
Overall using this watch was pleasant. I was worry that the size of the watch might be a turnoff but because of the size of the watch, it was able to display more information on it. You can glance at it without much effort to read the time, altitude or temperature. As for the backlight, I felt that it was too dim but it's still useful. The negative display is very visible during daytime and even under a bright sunlight. During night time, the backlight is good enough to light up the display. As the styling of this watch is a sports watch, I mostly wear it during hiking or outdoor activities. As this watch has tons of features, the operation of the watch might be too overwhelming for some people. The typical user manual from a China company doesn't help either. I have to explore the watch by myself and rewritten the user manual. You can find the user manual at https://almost-a-technocrat.blogspot.com/2018/09/a-better-skmei-1358-instructions-manual.html
Tumblr media
Watch bands disassembled
Tumblr media
SKMEI 1358 without bands
(via https://ift.tt/2DBVQL0 )
0 notes
almost-a-technocrat · 7 years ago
Link
Tumblr media
This SKMEI 1358 digital watch is a great watch for a really cheap price. However, the instructions manual is far from good. It took me some time to explore some of the functions and at the same time trying to understand the instructions manual provided by SKMEI. I decided to write an alternative instructions manual for this watch so that other owners of this watch might benefit from it. But never the less, I am not a good English language writer myself. But I do think it is still better than the instructions manual provided. Feel free to correct me using the comment section.
A better alternative SKMEI 1358 instructions manual
(via https://ift.tt/2CcX4N1 )
0 notes
almost-a-technocrat · 7 years ago
Link
Tumblr media
SKMEI 1358 does not have an extensive world time zones like my Casio SGW300HD-1AV or Casio AE-1200WHD. It only has one time zone that you can set whenever you reach another country with different time zone. I think it is enough for most people who will only travel to one country at a time unless you are a globetrotter that visits multiple countries in one go.
Buttons and main screen layout
Tumblr media
Setting the 2nd time zone time
1.    Press and hold the MODE button to enter the setting mode.
2.    Press MODE button to select hour or minute.
3.    Press UP or DOWN button to increase or decrease.
4.    Press and hold the MODE button to apply the setting.
SKMEI 1358 other contents
(via https://ift.tt/2NgcfZU )
0 notes
almost-a-technocrat · 7 years ago
Link
Tumblr media
The SKMEI 1358 timer can be set up to 24 hours of countdown. The countdown timer operation is similar to other watches and it should not be complicated to operate.
Buttons and main screen layout
Tumblr media
Starting and stopping the countdown timer
1.    Press the START button to start or stop the timer.
2.    Press the RESET button to reset the timer.
Setting the countdown time
1.    Press and hold the MODE button until the hour start flashing.
2.    Press the MODE button to select hour or minute or seconds to set.
3.    Press the UP or DOWN button to change it.
4.    Press and hold the MODE button to apply the setting.
SKMEI 1358 other contents
(via https://ift.tt/2LVtaMx )
0 notes