Saturday, July 02, 2016

Trying to mount my phone sd card on Ubuntu 14.04

Problem
Find the mount point of LG G4 sd card on your linux machine, so I can back it up as an image and then restore it on another card.

Found some good commands on this blog
http://a3linux.blogspot.com/2015/08/linux-block-device-commands.html

This is it so far.. Have not had any success in figuring out where the gvfs-fuse file system is mounted.

Found another answer on stack overflow
http://unix.stackexchange.com/questions/276693/how-do-i-force-gvfs-unmount-a-dead-ssh-mount-on-linux-mint-16-petra

YOur android phone uses gvfs type filesystem. This link above shows how to unmount the file system when you connect your phone to the computer. Still havent figured out where the mount point is.


Apparently this is not possible
http://askubuntu.com/questions/652544/permission-denied-for-dd-of-android-phones-file-system-connected-over-mtpfs-i

Good explaination why you cant copy mtpfs here

https://android.stackexchange.com/questions/116275/permission-denied-for-dd-of-android-phones-file-system-connected-over-mtpfs-i

Friday, August 22, 2014

Setting up VI or VIM for editing in Python

Exactly a year ago(ok more than a year ago) I had posted about how to set up color schemes in VIM. Back then i had just discovered the command :colorscheme. The shitty post can be seen here.

This year, my plan is to teach or re-teach myself python. I have been making good progress with the awesome free book Dive into python.
Now that I am a little bit more comfortable with Python and have been using it for day to day problem solving. I now need a development environment.
I use a windows machine at work with cygwin. I also use gvim. If you want to customize vim in cygwin, and want to customize gvim, both have their .vimrc files.

Here are some tips to remember in the future.

1. cygwin- You must install vim and not just vi. They are different. You can place your custom .vimrc in $HOME/.vim/vimrc. Note there is not a dot before the filename. To see if this file is being read by vim you can start vim in debug mode using vim -V . Read the output on the screen to see if your vimrc files was read. This is where you can put your own custom settings. 
2. Gvim - On windows the install path for this C:\program files(x86)/vim/. Here you will find a file _vimrc. This is where you can put your custom vim settings.

Now on to some custom settings that I have liked so far.

Colorscheme.

I liked the color scheme moria for gvim. It can be downloaded from here. To enable this in gvim enter the following line in your _vimrc file

color moria

I have not yet figured out how to enable this in vim in cygwin.

Python specific settings.

Following lines are pretty self explanatory for editing python files.

set textwidth=79  " lines longer than 79 columns will be broken
set shiftwidth=4  " operation >> indents 4 columns; << unindents 4 columns
set tabstop=4     " a hard TAB displays as 4 columns
set expandtab     " insert spaces when hitting TABs
set softtabstop=4 " insert/delete 4 spaces when hitting a TAB/BACKSPACE
set shiftround    " round indent to multiple of 'shiftwidth'
set autoindent    " align the new line indent with the previous line




Wednesday, April 30, 2014

GNU parallel tip


Tip about GNU parallel. Cos everything in linux requires stackoverflow.

http://stackoverflow.com/questions/16448887/gnu-parallel-not-working-at-all

Motivation about Nostalgia


I just read my own posts from past years. It is an amazing view into my own life. The most vivid memories are painted by posts from 2005. Back then I was really enthusiastic about Blogging or may be I had more time on my hand. Although I do believe that time is never really a problem. I do make time to shit right?. There the central theme of the blog "Shit", I said it.

Life has changed, I have changed and I am glad blogger is still there and has kept my blog around. Every year for the past few years, I have tried to write more, even said it publicly on this blog, that I will write more. Some how, I haven't done it. The reason- I blame life, yes you life, you are the source of all the problems in my life. I mean life happens. Time passes by and we all get responsibilities and suddenly your blog is empty.

So a new plan for this year, just write shit. I actually have opinions that when expressed in public usually piss people off, because people of my age get really sensitive about their own shit.
So this will be my sounding board from now on.

What do I plan to write here, just whatever shit I want, Didnt I say that in 2005 when i started this shit? Damn right I did, so what I can say it again and not do it again and blame life again for happening.
Actually no, I will, this time around. So the first post of the year 2014 is about  positive motivation.
If you wanna do something, be positive about it, imagine yourself doing it, tell your friends what you are going to do. Research has shown that when you do this,  you are more likely to do it. So if you talk positive about something to someone, you are more likely to succeed. Research has also shown that when you talk about your goals to others, you are more likely to not succeed as your brain is tricked into thinking that you have already accomplished that task.

So what does this tell us? That most research about motivation is shit,at least on the interwebs. So instead of doing a bunch of googling about how to be positive or keeping yourself motivated, or building up motivation to do something, just STOP! I have the solution for all your procrastination, this includes mine. Just read this one blog. That is it, it will make your ultra productive, and when you are productive, you will most likely be positive about shit in your life and achieve your goals.
Yes, there is not substitute for doing the shit that you intend to do. The hardest part is taking the first step and the hardest part is taking the second step, the third step, the forth and so on.. It is all really hard, just know it, understand and then just work at it.
I should have titled this post has Make money, one day when I become a famous blogger, I will.



Thursday, June 13, 2013

vim colorschme in ubuntu

Color Scheme for vim
I wanted to change the default color scheme for vim as i was editing some python code on Ubuntu 12.04 LTS.
The default color scheme is fugly for python and does not make for a pretty sight.
I wanted to change it and since vim is so widely used, why re invent the wheel.
Using my google fu, I found the following links to be useful.

1. http://askubuntu.com/questions/24544/what-is-the-default-vim-colorscheme
This explains where the default color scheme is stored in ubuntu or debian based systems.
Tl;dr - you can find out what color scheme you are using,
type
:colorscheme
To change the color scheme
:colorscheme

To find out the different colorschemes available in your system, go to
/usr/share/vim/vim73/colors

I now want to change the color scheme

Wednesday, July 25, 2012

Bash Tips

To  save a file to stdout and also to a file

ls -al | tee blah.txt
for more explanation of the technique check out this blog

Examples of cut


Monday, August 01, 2011

Running

Well, this is the first and last post of 2011, no I am not dying nor am I denouncing society and moving away to the himalayas( I am shit scared of heights )
Ok, I lie, I hope it is not the last post of 2011. I have decided to run a half marathon, which I decide to do everytime this year and then like clockwork, my body decides to be a bitch and shows the middle finger to me. So this year, lets see.
First run of the year
Distance 4 miles
Time: Unknown. Or may be i should write down as too much.
Afterwards- IT band on the right leg tightened up like a republican at a gay wedding.
Next run - Sunday Aug something.

Wednesday, March 16, 2011

How to make a div 100% height in css

Awesome, clean, concise to the point explaination. Googled it and found this link