Wednesday, November 12, 2014

Fix samsung error: E:failed to mount / efs (Invalid argument)

I got a Samsung Galaxy Note 8 GT-N5100 with error E:failed to mount / efs (Invalid argument) whenever I run a wipe cache or wipe factory in recovery. I did stuck in a samsung logo. This looping is a common nightmare for a Samsung devices.

There is a fix for this error. Follow this steps:

Ready a ROM(I use Pac Man ROM) in your microSD and insert into device.

1) Download and flash official firmware for your phone using Odin.
2) Root and flash custom recovery(I use TWRP) using Odin
3) Install ADB on your computer(Usually by installing Samsung USB driver)
4) Boot into recovery mode(hold up+power button)
5) Connect phone to PC via USB Cable
6) In recovery mode Choose “mount and storage > mount /system”(In TWRP, just tick the 'system')
7) At PC, open ADB command window and type :

adb shell
su
dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img
mke2fs /dev/block/mmcblk0p3
mkdir /efs
mount -t ext4 /dev/block/mmcblk0p3 /efs

DON'T REBOOT YET, Now /efs is mounted don't unmount it.

Do a factory reset

Install your new rom, It should install without any errors

Boot your phone,  After it boots your signal notification most likely will be gray and internet or calls may not work. To fix just install gapps and it will be fixed.

If you don't have phone, try this:

Go back into recovery and get adb access. Then run this command:


sumke2fs /dev/block/mmcblk0p3mkdir /efsmount -t ext4 /dev/block/mmcblk0p3 /efsdd if=/sdcard/efs.img of=/dev/block/mmcblk0p3 bs=4096reboot

This command will create a generic EFS files on your device.
Now normally your device will reboot and it should pass Samsung logo.
Your device might display a screen with a yellow text (FactoryMode)

If your device display a annoying transparency black background which contains some info about your device (PDA, Phone, CSC, H/W, Camera, …) in yellow text … and lock screen is not working, mean that your device is in factory mode.

“Factory Mode” is enabled if the EFS partition is corrupted because of installing custom ROMs, bad Mods or downgrading your current system version or after you succeeded in fixing the EFS partition.

Follow this step to exit FactoryMode:

1) Install root browser
2) Go to Local > / Device > efs > FactoryApp and open factorymode as text in “ES Note Editor”
3) Change it from OFF to ON and save it
4) Open keystr as text in “ES Note Editor”, change it from OFF to ON and save it
5) Reboot

Alternative solution by using Terminal Emulator.
1) Install “Terminal Emulator“
2) Type :

su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot


References:
http://forum.xda-developers.com/showthread.php?t=2430202
http://zidroid.com/how-to-fix-failed-to-mount-efs-for-galaxy-s3-gt-i9300/
http://zidroid.com/how-to-exit-factory-mode-for-samsung-galaxy-devices/
http://www.digitalreborn.com/fix-samsung-galaxy-unable-mount-efs/

Tuesday, November 11, 2014

2.2.1 Reason to use DTN

Internet Protocols (IP) required end-to-end connectivity. It operates poorly in an environment with a very long delay path and frequent network partitions which causes by severe power or memory constraints by end nodes which make the network infrastructure lacking ‘always-on’ environment. Delay and disruption can be caused by long distance and time. There are some fundamental assumptions in the internet architecture that can cause a break in the network under long delays and intermittent connectivity such as [7] [3]:
i.                    There is always an end-to-end path between source and destination exists.
ii.                  Need to establish at least one round-trip or transmission and response before any application data can flow. This means that there is a requirement of the sender and receiver negotiate a connection to regulate the flow of data.
iii.                Retransmissions from the source are good way to provide reliable communication.
iv.                End-to-end loss is relatively small.
v.                  Endpoint-based security is sufficient to meet most security concerns.
DTN is used to tolerate long delays and intermittent connectivity which is a weakness in Internet Protocols. DTN is able to enable a connection when there is no end-to-end path between the source and destination, the round-trip is not needed to regulate the flow of data, retransmission from data receivers is not in use for repairing errors because there is no end-to-end path and unlike IP, DTN is ignoring the end-to-end dependency such as in IP fundamental assumptions (iv) and (v). There are environments that exhibiting some of these characteristics which are:
i.                    Space communications where there are high latencies, intermittent connectivity due to antenna schedule.
ii.                  Sensor networks when nodes need to power down to conserve energy.
iii.                Line of sight radios especially for urban area with wooded/hill environments.

iv.                Mobile networks

Friday, November 7, 2014

Unhide hidden folders and files after infected by virus

There is occasional problem occurs when you plug in your USB Thumbdrive to somebody laptop or PC and then suddenly your files and folders was infected and hidden while being replace by nasty shorcuts.

First important steps is to install antivirus and virus definition updated, then scan whole infected computer. In this case, I always use AVG Free.

Then use ccleaner to clean up all the mess in the computer.

After that, we need to fix the hidden files and folders problem. This is the command line to fix the problem:

attrib -H -S G:\*.* /S /D

G: is my USB Pendrive path. Use yours.

cygnosis

Wednesday, November 5, 2014

Installing Wget on Windows

Wget is a linux downloading tools. Not all know that it also available on Windows.

Download wget installer for windows here

Setup path at Environment Variables to installation location.

usage: wget <url>

References: http://gnuwin32.sourceforge.net/packages/wget.htm

2.2 Delay Tolerant Network (DTN)


Delay and disruption tolerant networking (DTN) approach is to overcome the network connection problem when there is no end-to-end connectivity in Internet Transport Protocols. DTN is an approach to computer network architecture that seeks to address the technical issues in heterogeneous network that may lack continuous network connectivity. The DTN application must tolerate delay and disruption with acceptable performance in high loss or delay error environments.

Monday, November 3, 2014

2.1.3 TCP/IP Operation

Figure 2.7 shows TCP/IP operation of accessing a website. After a user click on the website link, the application uses DNS client software to request DNS Server to send an IP address of the destination host. The DNS client software uses UDP and IP to build a DNS name query message to request the IP address of the host that the user wants to connect to. Link layer builds an ethernet frame and pass it to the network operating system to be sent to the DNS Server. DNS Server sends back the DNS name query response message and a target host IP address. It comes in link layer, goes through IP layer where the address information is stripped off and goes back through UDP where the packet integrity is checked. Then it goes up to the DNS client software and passes the IP address to the application.

Figure 2.7: TCP/IP operation of accessing a website
The application then instructs TCP to create a connection. After a TCP connection is established, the application requests a file from the target host. The target host uses TCP to segment the file user wanted into packet and send it to the client. Each packet comes through link layer, through IP and passes it up to TCP which verify the segment integrity and hold until all files segments had arrived. It also acknowledges receiving of the packet to the sender. This cycle repeated until the whole files had been reassembled.

If the packet arrive does not pass the integrity check, TCP discarded it and not send acknowledgement to the sender. If the last packet was not acknowledged within a lot of time, the sender retransmit it. When the last packet arrives, the files are reassembled and acknowledged to the sender. The client then closed TCP connection. The completed files passed to the application where users can access it.

Running telegram CLI on Debian based Linux

Telegram already become my ultimate messenger applications. It is multiplatform. Based on cloud computing, no worries to transfer to other devices. It is all synchronize. Attachment like emails support. I love it. What's more it did support CLI.

git clone https://github.com/vysheng/tg.git && cd tg
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev
./configure
make
bin/telegram-cli -k tg-server.pub

usage:
msg contact_name text

quit