Using ‘git remote’ to add a remote origin manually
Before reading this post please understand what ‘local’ and ‘remote’ repositories in git means. This is very important to understand difference between local and remote git repositories.
In simple words,
local git repository is a directory which exists in your computer.
remote git repository is the directory which exists in your github account ( or say bitbucket ).
Suppose say you have some day-to-day-use shell scripts in your computer ( say in $HOME/.scripts/ directory ) and you want to store them into a new repository ( this remote repository doesn’t exist yet ) in your Github account.
Note: You are not cloning a remote git repository into your machine here at all. You are just pushing your already existing local scripts into a newly created remote git repository using ‘git remote’.
Do the following things
- Go to your github page and create a new repository called ‘scripts’
- Now go to your local directory which contains the scripts ( which is in your machine ) and initiate a new empty local git repository using this command
git init - Now add the file contents to index using
git add * - Commit the changes
git commit -m “adding scripts” - Since this local_repository/scripts_directory is not a clone of any remote git repository yet, no remote origin exists for this local directory. You have to add the manually created ‘scripts’ directory as remote origin ( See first bullet )
git remote add origin https://github.com/<github-username>/scripts.git - Last step is to push the local scripts to remote repository
git push -u origin master
Now go to https://github.com/<github-username>/scripts
Voila !!!
pacman error: failed to commit transactions (conflicting files)
You may get the above error when you are upgrading a package or installing a new package.
Suppose you get an output like this:
error: could not prepare transaction error: failed to commit transaction (conflicting files) package: /path/to/file exists in filesystem Errors occurred, no packages were upgraded.
There is a simple trick to overcome this.
run pacman -Qo /path/to/file
If this file is owned by any package, then file a bug report. Otherwise, rename the file ‘which exists in your file system’ and re-issue the update or install command. Everything will be fine.
A few words on Arch Linux
I use KDE .
I always wondered that, whenever I visit IRC, why most of the hackers out there criticize about using Kubuntu (A debian based KDE distro). Most of them use Arch Linux and of-course some use Gentoo also. I had used ArchLinux + KDE earlier, properly configured for my need and taste. But I had to say good bye too soon as I screwed my laptop. So never had a chance to properly enjoy Arch Linux.
And I don’t know, I became too obsessed with Kubuntu than any other KDE flavors. And never used other distros since then. Trust me, I hear good things about Linux Mint. But never even tried it.
Over the time, I started getting irritated with Kubuntu. There are several problems occur while using it. First of all while installing lot of garbage also get installed. You never use those apps in your lifetime. Then why install it ? Also removing applications one by one sitting whole day is also not possible.
There are few annoying problems. Heating and fan speed. I installed ATI proprietary drivers. Then tried some more tweaks. They all worked for few days. But again started giving trouble. I could hear my laptop fan sound over my ceiling fan :D.
Next comes LCD brightness - battery monitor. I must say battery monitor sucks in Kubuntu. If you use battery monitor ( which resides in system try ) to control display brightness. It doesn’t hold still. It was irritating while I watch videos. Of course there is some trick to hold display brightness at constant desired level. ;) But it also started not working after a while.
And there are much more.
I finally switched to Arch Linux a few days ago.
Now my laptop doesn’t heat much. I can not hear my laptop fan’s sound while ceiling fan is running. It do not consume too much of RAM, there is no inconsistency in display brightness. Boots up and shuts down too quickly. Everything is suddenly fine and my system is stable. It works the way I want.
Now I am going to tell a few words about Arch Linux
Arch Linux is cool. It just works the way I want. Everything runs fine in Arch Linux. There are lots of tricks and tweaks to make your Desktop works like the way you want. No unnecessary cluttering, heating, display brightness and many more.
Arch Linux follows a Rolling Release model of software upgrades. So you always be the first person to enjoy new stable version of a software when it is released, by using a single command.
You can install official packages and user builds using Pacman. You can use yaourt to install packages from AUR.
I would like to give a few tips for getting started with Arch Linux
- Follow Arch Linux beginner’s guide for installation. It’s great for beginners.
- Before installing Arch Linux please make sure that you have a good internet connection, in case if you want to install a full KDE package or any other.
- Make a note of this. If you have tried to install ArchLinux an year ago on your laptop, believe me, you will love the wifi-menu thing while installing now :)
- Arch Linux is always best for usage with a lightweight desktop environments. If you are such a person, please do not install a Desktop Environment at all. Just use ArchLinux + a Window Manager like Awesome WM or Openbox. Both are awesome. But in my case, I like to use KDE plasma workspace. So I use ArchLinux + a base, minimal installation of KDE desktop.
- The best thing is, while installing Arch Linux, you are free to choose whatever you want to install ( of-course dependencies are necessary and must). No need to install all the garbage you don’t want and don’t need.
- I suggest to use wicd for network managemment
- Always look for solution in the Arch Wiki to get rid of your problems. Its the best guide I have ever seen. Its neat, handy and almost complete. You will get solution to most of your troubles in Arch Wiki itself.
Just try it for a few days. All you need is ArchLilux .iso file, a USB stick, A day to spare and the Desktop Environment of your choice.
So in my opinion, your system should be in The Arch Way.

PS: Even Gentoo is great. My friend uses it. I think, it is much more cooler than Arch Linux if you are lucky and you know how to make use of forums and IRC when you are a beginner and become an expert in Gentoo. But all you need is PATIENCE and a good CPU. Because Gentoo installs a software by downloading necessary source code of the software you want to install and dependencies and compiling them locally on your machine. So better CPU, better installation speed.
Believe me. You will learn a lot about Unix systems using Arch Linux or Gentoo
Mount ntfs partitions in rw mode in arch linux
Trouble mounting your ntfs patitions in arch linux ?? Use ntfs-3g . Its an open source implemetation of Microsoft’s NTFS which includes read-write support. Its super cool. Find your ntfs partitions UUID by running lsblk -f
Remember, you have to create a mount point in /run/media/user1 before editing /etc/fstab
for e.x. # mkdir /run/media/user1/Windows
Then edit your /etc/fstab. Add a line.
# Mount internal windows partition with linux compatible permissions, i.e. 755 for directories (dmask=022) and 644 for files (fmask=133) UUID=<uuid-of-ur-ntfs-partition> /run/media/user1/Windows ntfs-3g uid=1000,gid=1000,dmask=022,fmask=133 0 0
By this you can mount ntfs partitions with Linux compatible permissions i.e. 755 for directories and 644 for files using dmask=022 and fmask=133
programming is terrible: How to parse Ruby
If you want to parse Ruby, I wish you luck—there isn’t any documentation or a formal grammar that fully describes the language. Instead, you have to look at the source code to truly understand Ruby’s syntax. This is where the nightmare starts.
Take a look a Ruby’s parser, defined in parse.y….
