Bug in Credit Card related script in Allegro

I have just found and reported bug in credit card related form/script in popular Polish trading platform Allegro. This was just a minor compatibility issue.. ;-)

Google Hangouts related feedback

I have just reported several issues and ideas related with this nice Google Hangouts Android application:

  • The name Hangouts is not popular and hard to remember. Abandoning “Google Chat” or “Google Talk” was a bad idea. People tend to remember short names and popular words such as “Skype” or “Viber”. This may be funny but people really cannot remember “Hangouts” well.
  • Receiving calls is misleading. There are several different ways to answer an incoming call in Hangouts. Most common way is to press a button and then drag it onto an icon that is not visible until you press a button. Another way is top view pop-up which could have color buttons in addition to small icons. Older people have problem with this. Average non-geek user simply needs Green Answer and Red Reject button.
  • Hangouts would be simpler to use and more popular if it worked just as an ordinary Phone Call application. Non-geek users have this habit already on how to use Phone Call application, that Hangouts should leverage.
  • Hangouts voice/video call should be available directly from a Contact Book if gmail address is present. Just as phone call.
  • There are Android devices that offer hardware phone buttons (such as LG Wine Smart). Green Connect and Red Disconnect buttons should be also available to perform actions in Hangouts.

These simple ideas arised from observing older people trying to use Hangouts to videocall their family members..

Android Game Controller

It is possible to connect a game controller to Android based device and use it as input for your application [1].

[1] https://developer.android.com/training/game-controllers/index.html

Android USB OTG HOST

Most modern Android based devices support USB OTG function [1]. USB is a Host centric bus that means there is only one Host device and many different Devices can be connected to it. Using inexpensive USB-OTG cable it is possible to swich smarphone USB port from Device to Host, and connect external devices, if chipset and OS build allows this. Google provides detailed information on how to code USB Host [2] in your application.

[1] http://www.usb.org/developers/onthego/
[2] https://developer.android.com/guide/topics/connectivity/usb/host.html

CeDeROM CASING for M24LR-DISCOVERY

As an exercise, I have just designed (using FreeCAD) and 3D-Printed (using semi-translucent PLA material) a casing for M24LR-DISCOVERY (CR95HF NFC Reader). Let me know if you need one :-)

Read More

Sony Xperia Service Menu

You can enter Service Menu on Xperia devices with code:

*#*#7378423#*#*

Xperia Android Bootloader Unlock

It is very kind of Sony that they created an easy way to unlock Bootloader of Xperia Android Smartphones. You can now customize your phone firmware and OS :-)

http://developer.sonymobile.com/unlockbootloader/unlock-yourboot-loader/

Sony Xperia M5 Bugs

I have just bought next inexpensive Xperia M5 phone with pretty nice hardware. However I already found those things to be missing or deliberately removed:

  • USB OTG does not work (solved).
  • CardBoard VR does not work.

Update regarding USB OTG – “it’s not a bug its a feature” – after you connect a USB device using OTG cable you need to run “Detect USB device” application that will make OTG work. Considering security this may be a good choice to allow external devices by hand.

Docker is NOT a Virtual Machine Hypervisor

Some people confuse Docker to be a virtualization hypervisor host. Unlike VirtualBox or QEmu, Docker is an automated container system tightly related with a Linux system (only). It is something like Jails for FreeBSD (that has been there for years already).

UNFOCUS

What if, life is just an illusion of Ego, so convincingly tempting that we forget everything just after birth.. What is the purpose of Meditation? What happens when we really unfocus from Ego? How deep is Void? Who is John Galt?

Joomla portal access recovery

In case you need to reset admin password for a Joomla install, you can do this by simply updating database record.

$ mysql5 -h <database_hostname> -u <database_username> -p <database_name>
Enter password: <database_password>
mysql> show tables;
(...)
mysql> UPDATE <database_prefix>_users SET password='d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199' WHERE username='admin';

This will use mysql5 commadline client to connect to a given database. You will see if tables are in place. Then you will update password hash of user admin to secret which equals:

d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199

You can also use any other database client of your choice, DBeaver is also nice utility with graphical user interface.

You can obtain necessary database access information from configuration.php file accessed by ssh/ftp on a web server.

public $dbtype = 'mysqli';
public $host = '<database_hostname>';
public $user = '<database_username>';
public $password = '<database_password>';
public $db = '<database_name>';
public $dbprefix = '<database_prefix>';

If you want to dump/backup a database into local file, use mysqldump5:

mysqldump5 -h <database_hostname> -u <database_username> -p <database_name> > dumpfile.sql

If you want to restore a database from a local file, use mysql5:

mysql5 -h <database_hostname> -u <database_username> -p <database_name> < dumpfile.sql

Google Android Nexus Device Un-Brick

GoogleNexus

If you happen to brick your Google Nexus device you can always use stock ROM images [1] to revert it to a default and operational state. Package contains not only OS but also bootloader and radio firmware images!

I have bricked my device by installing custom firmware that messed partitions layout inside a Flash Memory. I have seen lots of people having similar problem of endless bootloader-loop. There is no need to send a device to a service when bootloader is operational. All you need is a stock firmware image from Google [1], USB cable, and fastboot utility from Android SDK. If you happen to damage a bootloader, then hardware manipulation at low-level is necessary over JTAG, I can help to recover your device in that case.. no worries :-)

[1] https://developers.google.com/android/nexus/images

Android: dynamic string processing

There are two easy ways to replace text on-the-fly in Android. This may be required if you want to insert some text/values into displayed text, or construct a data packet of some sort. Both require some code to replace given part of the string.

First is to use HTML/XML tags and then handle them with your own implementation of Html.handleTag(). Unfortunately, String conversion removes the tag in the background, so you need to escape < mark with &lt; in the string resource. This approach is good when you want to put variables inside a string and then process them later in one place using tag handling – that is when you want to have a tag handled at processing time – so you only change tags and one processing routine.

Second is to use Format Strings instead of XML/HTML tags. It seems simpler, faster, and evades hidden conversion problems. getString(resource, ...) works like a well known printf(string, ...). This approach is good when you want to process each string manually at runtime, but strings and variables are hardcoded.

[1] http://stackoverflow.com/questions/7899563/android-converting-between-strings-spannedstrings-and-spannablestrings/34556513#34556513

Dualshock4 PS4 Controller Bluetooth Pairing

dualshock4-bluetooth-pair-cederom

There is one simple way I have discovered to pair with Dualshock4 Playstation4 controller using standard Bluetooth Pairing Procedure. Make sure controller is turned off, then press and hold SHARE button, then press and hold PLAYSTATION button until LED starts to blink (two short white blinks every few seconds). You can now discover and enjoy your Dualshock4 controller with any Bluetooth (HID) enabled device. No cables and no additional applications necessary! :-)

Dualshock4 is a really nice high quality and precise controller that can be used in many more interesting applications than only playing games. It is compatible with Bluetooth HID and USB HID standard. It contains 2 analog joysticks, 2 analog sliders, 13 buttons, touch-pad, accelerometer, vibrator, audio speaker with headset port, RGB LED, micro-USB port, and external expansion port..

Unfortunately, lack of self-compatibility seems to be a strong disadvantage of Playstation platform. Not only because PS4 does not run old software. Dualshock4 seems to have different way of handling button events as compared to Dualshock3 (default Playstation3 controller). It has some sort of auto-repeat feature (like PC BIOS keyboard) instead of button change events (like MIDI). This renders Dualshock4 unreliable on Playstation3 platform because of massive control glitches. Also DS4 PS button does not produce system menu on PS3, so you cannot use it as the main controller replacement. Sadly, it is impossible to use DS3 controller on PS4 as well. Hopefully, switching CPU to AMD64 and OS to FreeBSD could bring more self-compatibility to Playstation in future..

Telemedicine and eHealth 2015

It was great fun and pleasure to take part in Telemedicine and eHealth 2015 conference organized by Polish Telemedicine and eHealth Society.

As a member of organizing committee I managed technical/IT part of the conference. After the conference, during the general meeting, I have been re-selected as a Society Board Member.

HackRF(One) on FreeBSD

My port of HackRF has been committed. Enjoy your HackRF One SDR on FreeBSD OS! =)

15th World Helicopter Championship

whc2015

It was great pleasure and honor to help organize 15th World Helicopter Championship in Zielona Góra / Poland as Technical Staff and Assistant Judge. It was quite a challenge, great lesson, but most of all amazing adventure! Thank you for this opportunity!! :-)

tcedro-whc2015-helisport-technician-lqtcedro-whc2015-judge-assistant-lqtcedro-whc2015-letter_of_appreciation-lq

Fixing corrupted GPT backup

When you setup system on a fresh disk you may encounter a problem of corrupted GPT backup. This will happen even more likely when you messed with MBR before on that disk. Free and Open GDISK utility will help you. GDISK will tell you current state of the disk and partition tables, also warn you on possible problems. When you print available partitions (‘p’) and they seem okay, you can simply write out (‘w’) the partition table, that would fix the GPT backup corruption problem :-)

RAID HDD and UEFI BIOS

If you want to build your own disk array, let’s say RAID, on your computer to increase disk space and efficiency, you should know about few important things in general:

  • You can consider MBR and x86 obsolete. New way is GPT, UEFI, AMD64.
  • Large RAID arrays (over 2TB) will not work with older hardware and OS (except FreeBSD) due to architecture limitations.
  • To use large RAID volumes you must use GPT partition scheme. MBR will not do the job.
  • Some systems can use GPT only with UEFI BIOS (i.e. Windows works with GPT only via UEFI). You may be forced to buy new motherboard.
  • UEFI and GPT is totally different way of bootstrap so you can forget what you know about BIOS and MBR here.
  • Hard Drives have hidden corruption-fix mechanisms in firmware that will make your RAID array fail to operate. For RAID choose dedicated drives such as WD RED (not Green, not Black, not Blue).

In order to use GPT and UEFI I have replaced my nice ASUS M4A88TD-V EVO/USB3 motherboard with M5A97 R2.0 only because M4 series did not support UEFI. New BIOS is totally different, but I am not really sure if replacing the hardware was mandatory..

Summing up, if you want to use large RAID volumes make sure first that you can use GPT and UEFI BIOS is present on your AMD64 hardware. If not, still you can use the FreeBSD as it knows how to bypass some limitations. Also remember to use dedicated HDD for RAID operations.

No USB Mouse/Keyboard in Windows 7 installer

If you find keyboard/mouse to be missing when installing Windows7 on a new hardware, make sure you are connected to USB2.0 ports not USB3.0. New hardware host of USB3.0 may not yet be supported by older installer software.

Mac OSX USB installer

In order to create OSX installer on USB memory drive you need to:

  • Download the Mac OSX Yosemite installer from AppStore on you Mac.
  • Create installation media from Terminal by executing following command (remember to adjust YOURUSBVOLUME value):

    sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/YOURUSBVOLUME --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
  • Boot target Mac from USB by pressing ALT/OPTION key while powering-on the computer.
  • Remember to format target drive first with Disk Utility if you want to perform clean installation.

Mac OSX Bluetooth Modem resource busy

In case you wonder why your device does not connect as Modem via Bluetooth to the Mac OSX, or you cannot see COM port on Windows, your mobile device may not simply support or provide DUN (Dial Up Network) and/or SPP (Serial Port Profile) profile.

On Mac OSX I got following error, until I tried another device and/or starting by hand DUN service on a mobile/client machine:

cannot open /dev/cu.Bluetooth-Modem: Resource busy

Notes:

  • Read Bluetooth specification for Serial Port Profile.
  • Read Bluetooth specification for Dial-Up Network Profile.
  • Modern mobile phones / USB 3G dongles, unfortunately, do not provide direct AT/Hayes access to the Radio Modem anymore.
  • You can install DUN application for your smartphone, but it will be only a simple dummy wrapper imitating modem for simple applications, but they do not provide full modem functionality, beware, its a fake.
  • Its only necessary for devices to be paired first in order to get SPP/DUN working. If device does not provide serial port over bluetooth when devices are paired and online, probably its just not there implemented.

FreeBSD sFTP SSHD chroot nologin

There are situations when you have a nice server out there, and you want/need someone to upload important files, but you only want to give them a minimal access to the system. You can use SSHD with sFTP and /sbin/nologin shell for that in chroot environment (dedicated limited userspace). Note that SCP in fact requires a working shell, so you need to use sFTP in this case..

Create a new user account with existing ftp group and /sbin/nologin shell:

# adduser

Alternatively you can modify an existing account to share:

# pw groupmod ftp -m username
# pw usermod username -s /sbin/nologin

You need to set correct permissions to the user home directory and public directory inside for upload:

# chown root:wheel /home/username
# mkdir /home/username/public
# chown username:ftp /home/username/public

Now modify the SSHD server configuration file /etc/ssh/sshd_config and append:

Match Group ftp
        ChrootDirectory         /home/%u
        ForceCommand            internal-sftp
        AllowTcpForwarding      no
        PermitTunnel            no
        X11Forwarding           no

Remember to restart the SSHD in order to apply new configuration:

# service sshd restart

Once the account is not necessary anymore remember to remove it:

# pw userdel username

OSX 10.10 Yosemite install/runtime problem

If you want to perform a fresh installation of OSX 10.10 Yosemite on an older MacBook(Pro) you can obtain the installer with AppStore and then create the USB installation media.

In case you encounter an Installer Verification Error that prevents you from installing the new system try the following. Its not the system date not bad download as internets says.

This may also help you when encountering problems (i.e. USB Mass Storage) after system upgrade to Yosemite.

Try these boot keyboard shortcuts until you hear boot sound two times:

  • Cmd+Alt+R+P when powering on the Mac (NVRAM Reset)
  • Alt+Ctrl+Shift+PowerON alltogether (SMC Reset)

No problem, you are wolcome :-)

Apple MacBook and OS X

I have, finally, switched to Apple OS X. This is so close to my favorite FreeBSD (OSX is a Unix BSD / Darwin derivative) and it has all drivers and multimedia features working, that I think I will switch for good. This the simple, stable, and functional platform, where you can really focus on your work. Along with the MacPorts suite installed that provide access to the Open-Source / Free-Software I feel like home :-)

FreeBSD + PPP + GSM/3G/LTE Modem

If you want to use GSM/3G/LTE modem on your FreeBSD box you need to use PPP and following configuration:

default:
 set log Phase Chat LCP IPCP CCP tun command
 ident user-ppp VERSION 
 set device /dev/cuaU0
 set phone *99\#
 set redial 5 10
 set speed 115200
 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
           \"\" ATH OK ATZ OK AT OK-AT-OK ATE1Q0 OK \
           AT+CFUN=1 OK-AT-OK \
           AT+CPIN? READY-AT+CPIN=\"1234\"-OK \
           AT+CGDCONT=1,\"ip\",\"internet\" OK \
           \\dATDT\\T TIMEOUT 40 CONNECT"
 set timeout 10
 enable dns
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
 add default HISADDR

recursive list of sub-directories in reverse order

In case you need to list directories only in reverse recursive order for automatic list generation for directory removal on package deinstallation, here goes an example sh+find script that should work on all Unix platforms:

#!/bin/sh
dirlevel=3;
while [ $dirlevel -gt 0 ]; do
 find /tmp -type d -depth $dirlevel
 dirlevel=`expr $dirlevel - 1`;
done

GRUB2 default boot menu entry

Q: How to change the default boot menu entry in GRUB2 used widely on Linux systems?

A: You can do it easily as root in three following steps:

  1. Run update-grub program and copy entry name that you want to make default.
  2. Edit /etc/default/grub and add or modify existing GRUB_DEFAULT="your_menu_entry_here".
  3. Run update-grub program again to update the grub bootloader configuration.

SZD-54 Perkoz glider prototype SkyDive test



Virtual-Reality

Mind-Over-Matter – this is my Virtual-Reality =)

cederom-florabo-virtual-reality-20140223

Unit cost in mass production

In my first steps of mass production I have created a simple simulation of unit cost per production volume. On the plot we can see a price for two version of the final product – basic and full featured.

mass-production-cost-simulation-20140209

Looks interesting, as components cost highly depends on the order volume, prices can go down when purchasing more and manufacturing more – so called scale effect can bring more products for a lower price per unit. Next step is to negotiate better prices in high volume orders and choose between different distributors, then try the automated machine manufacturing..