Skip to main content

Posts

Showing posts from October, 2018

Easiest Way to Connect Raspberry Pi Through SSH Over WiFi

Here is a simple way to connect raspberry pi and ssh into it. Note: If  you are using pi zero, it is assumed that you have a usb wifi adapter connected through the USB port. Open terminal in boot partition of the SD card. Enable SSH: $ touch ssh Set Wifi Network: $ touch wpa_suplicant.conf ctrl_interface = DIR = /var/run/wpa_supplicant GROUP = netdev network = { ssid = "YOUR_NETWORK_NAME" psk = "YOUR_PASSWORD" key_mgmt = WPA-PSK } Line 1 is only for Raspbien stretch. Delete it if you are using Jessie. Connect through SSH: Insert SD card and boot. Find the IP address of the Raspberry Pi by accessing the router. e.g. BT uses 192.168.1.254 $ ssh pi@xxx.xxx.x.xx Enter default password: raspberry Done!

Installing Raspberry Pi image to an SD Card

Here is a simple set of instructions to set up the SD card for your Raspberry Pi in Linux. Download desired OS image. ( https://www.raspberrypi.org/downloads/ ) Set your SD Card for image flashing: Unmount the sdcard. This should give full access to gparted. Open GParted Software. I you don't have GParted, you can install it through the Following instruction: $ sudo apt-get install gparted Delete All existing partitions in the SD card . Reformat all into fat32. Flash image to sd card through dd command: $ sudo dd bs=1M if=/home/enzero/Projects/2017-01-11-raspbian-jessie-lite.img of=/dev/mmcblk0 status=progress /dev/mmcblk0 - The SD card directory. In my case, I was using the card reader port so it is mmcblk0 /home/<DOWNLOAD_PATH>/2017-01-11-raspbian-jessie-lite.img - OS image location

Using a Scanner In Linux!

Here is a list of instructions I had to do to use my scanner in Linux. Hope you find it useful! Install $ sudo apt-get install sane $ sudo apt-get install xsane Plug scanner through usb. Look for the scanner connected e.g. (Bus 005 Device 035: ID 04b8:1103 Seiko Epson Corp.) by typing in the following command: $ lsusb Edit the configuration file of sane: $ sudo gedit /etc/sane.d/(scanner brand).conf There should be line with “USB”. Add the device and id number (values from lsub output) to the “USB” line. e.g. ( USB 0x0035 0x1103 ) Start the program! $ sudo xsane

Unit Testing Critical Legacy Code

I once worked on a medical project which required intense Unit Testing in C#. A problem I encountered is that all of the critical sections of the code can't be accessed or required a massive amount of object dependencies. The dilemma I was in drove me to search for a new soluion. Good thing I found TypeMock Isolator. TypeMock Isolator is a mocking framework that can take control of function calls regardless if it is accessible or not such as privately declared functions and etc. This Framework is center-focused on white box testing legacy code; although, can be used for black box testing. Why use it? Code not Written using SOLID Principles Tested code is not following TDD(Test Driven Development) Testing legacy code Unrefactorable tested code Excellent for mission critical code. Mock Instantiation Using Typemock Isolator, object instantiations can be ignored. Ignore Constructor ClassToTest obj = Isolate.Fake.Instance<ClassToTest> (Members.CallOriginal, Cons

How to Rename a Local Branch in Git?

Renaming a local branch in Git is quite simple. To rename a branch from another branch, use this: $ git branch -m <current-branch-name> <new-branch-name> On the other hand, if already in the current branch, use this: $ git branch -m <new-branch-name> -m specifies the move operation. Pretty much the same kind of operation you would use to rename file in terminal.

Adding a new driver in WinCE

Here is a short guide on how to create your very own driver in Windows CE:  In solution explorer, go to C:\WINCE800\platform\${whatever board}\SRC\DRIVERS right click driver and press "Add"->"New subproject..." Select WCE Dynamic Link library and empty project. Add the following in ${drivername}.bib: MODULES IF BSP_DRIVERSHELL IF _WINCEOSVER=600     ${drivername}.dll $(_FLATRELEASEDIR)\${drivername}.dll NK K ELSE     ${drivername}.dll $(_FLATRELEASEDIR)\${drivername}.dll NK ENDIF ENDIF Add the following in ${drivername}.reg: [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\${drivername}]     "Prefix"="XXX"     "Dll"="${drivername}.dll"     "Order"=dword:4 Add the following in ${drivername}.def: LIBRARY ${drivername} EXPORTS     XXX_Init     XXX_Deinit     XXX_Read     XXX_Open     XXX_Close     XXX_IOControl Note tha