Wednesday, May 7, 2014

How to sync forked repos

Assume you are working on a forked repo and want to keep it synced with original one where you forked. But it is not limited to forked repos, it should be any two repos you want to merge together (Of cause you have to solve the conflict by yourself with your way).


  • Create a mirror repo for sync

git clone --mirror  [local_repo_name]
git remote add --mirror=fetch upstream

  •  Sync

git fetch --all -v --progress
git push --mirror -v --progress origin

  • Auto Sync
          You can add it to "cron" if you want it to be synced automatically. Not good at it. Maybe some would like to help me work out the syntax for it.
         

Job done. Hope simple python script would come soon.


Wednesday, April 16, 2014

Good BitBucket Python API and CLI Packages

Since start using GIT as version control system, I use put all my
repos on BitBucket. I love the unlimited private repos from them. But
no command line tools for it is really painful for Linux users. Then I
start looking for good Python API for it to write simple script to
create/clone/list repos. But my Python knowledge make it a hard task
for me to do a good script.

Today just before I try to add "Description" to create repo, I found
the API "python-bitbucket-api" with Python script already. Try it out,
it is really good. Just some small issues like install and argument
parsing. Now everything works fine for me. Hope new features will
coming from original author(s).

If anyone is using BitBucket and looking for a command line tool for
it, you can give it a try: hg clone
https://enchanter@bitbucket.org/enchanter/python-bitbucket-api


Wednesday, April 9, 2014

Start to Like Org Clock

Start the learn how to use "CLOCK" in org-mode. I love it. You can do
the clock in and clock out. Then you got your simple report on how
much time you spent on your little tasks or the whole project. That's
so easy and wonderful.

After 3 days, I figure out that I spend 2.05 hours on my current
project. Hope me boss would never read this post. The "CLOCK" will be
part of my self management tool from now.


Tuesday, March 11, 2014

Cygwin!!! Can you cause more problems?

I can't say I am a Linux guy because I am not expert but I do only
use Linux at home and office. Now I have a task to port a Perl
regression script to python and make it work on both Windows/Cygwin
and Linux.
Now let's talk about the Cygwin.
I am using Modelsim. I have no idea how to make work properly under
Cygwin. I can't pass Cygwin path to Modelsim commands. For example:
'vlib /home/enchanter/prja/work'. It failed. The solution I found
from Internet is using 'cygpath' to convert it to Windows like mix
style. (So ugly). I can't look back to my script again after add all
the 'ifeq xxx, cygpath' things.
Now it is g++ in Cygwin. Try to compile someone's C++ code. They
put –std=c++0x as compile flag. Cygwin g++ failed by can't find
definition of snprintf(). I found workaround from Cygwin mailist to
change it to –std=gnu++0x which is posted back to 2009. I don't know
why that problem still happened in 5 years later.
make also has problem. I can run 'make -h' to get the help
message. But when I try to really make something. I got error in the
middle like this "make: make : command not found"? What? If it is not
there how could you start make?
The next is x8664 Cygwin. I can't compile systemc-2.3.0 in it. I can
do it on Ubuntu x8664 machine, there's no problem. To debugging it
is beyond my knowledge, have to roll back to 32 bit version :-(.
Now I have to stop try Cygwin. Because it drives me crazy. Maybe I
should read the manual from the first page or find a tutorial to do
it line by line. But why can't it just make things as easy as Linux?
Isn't the Cygwin just try to let windows user use something like
Linux has? Nothing holds me back to Windows. My decision for know,
"Linux Only". I may update the verification environment someday later
when I'm able to work it work. Definitely not the near future.

Sunday, March 2, 2014

Pull Request has been Merged

I'm just too excited to post this because my pull request is
merged. Actually that is very simple change of a Python library and
what I have done is just changed then way to import the libraries to
make it support Python3. But it is the first time I try to contribute.
Really hope this could happened 20+ years ago when I was still
young. But even to late, right?

BTW, also remember a reply from a forum: "Change request? Why not just
change the code and send a PULL REQUEST?"

If you never do that, try it, simple change can be merged :-).


Wednesday, February 26, 2014

My First Blog Post from Emacs Org-mode

Have post anything for about 2 years. And now I am learning Emacs org-mode
That's really a wonderful tool I have ever seen before. Now try everything
with org-mode.

Here is the first post from it. Hope I can restart to post something useful
soon.

My blog will focus on what I am learning and plan to learn:

  • Emacs
  • Git
  • Linux
  • RTL Design
    • Verilog
    • VHDL
  • Verification
    • UVM
    • SystemC
  • Python
  • C++

Hope will become notes and progress tracking.