git (6) devops (4) python (4) (2) flask (2) github (2) cli (1) cron-job (1) dropbox (1) fix (1) hugo (1) macos (1) netlify (1) nginx (1) pip (1) rest-api (1) safari (1) seo (1) ssh (1) tip (1) ubuntu (1) virtualenv (1) zip (1)


11 October 2019

I was planning to do a clean install after macOS Catalina was released. I copied my ssh keys and I’ve seen the warning when I tried to run git-related commands.

After a short research, I’ve found out the source of the problem is the permissions on the private key file.

Using WhatsApp for Private Storage and Quick Transfer

25 September 2019

WhatsApp is undoubtedly one of the most popular messaging apps out there. You can use it a lot more than messaging with a little hack.

WhatsApp doesn’t allow you to send messages to your own number. Of course, you can use one of your friends for that aim but it can be annoying for your friend over time. A better way of it is using the simple trick below.

How to execute the last command with Sudo

30 May 2019

If you forgot to add sudo in your last command, you don’t need to type it completely. To execute ant last executed command by as super user:

sudo !!

How do I stop automatically unzipping downloaded Zip files in Safari

04 February 2019

The Safari browser opens automatically the files that is considered “safe” after it finishes downloading them. This can be very handy sometime but it can be dangerous as well. If you would like Safari just download the .zip files and leave it to you decided what to do, you can disable this feature.

Using File Finder on Github

25 December 2018

The first time I started to use Sublime Text I love the ⌘ + p shortcut combination. I really change the way I switch between files. After Github, I started to read codes on Github a lot.

Of couse you can use the search in this repository feature but it is slow and not good about listing files names.

Today I have discovered wonderful keyboard shortcut on Github: t

How to partially stage files

20 December 2018

GIT has a wonderful idea that is known as the staging area. The stage area is the place where you prepare the files that are going to be on your next commit. Sometimes you want to add only one specific part of some files.

You can use one of the following commands. This commands with their options will will break down your files into smaller portions named hunks.

git add -p <filename>

Moving from Flask to Hugo

18 December 2018

I have been planning to rejuvenate my personal website / blog with a new backend for a long time. I have finally moved to Hugo after messing with different kind of tech stacks over the time.

I have moved every single feature to Hugo successfully, but There are a few things that don’t fully work yet, but for the moment, I’m happy with my new site.

How to fix wrong Git Tag date

07 November 2018

You can add git tag to a previous commit using git tag TAG_NAME COMMIT_HASH, but it will ammend current date to that tag which can screw your repository by making out of chronological order. Don’t worry, You may fix this using the code below.

git tag -l | while read -r tag ; do COMMIT_HASH=$(git rev-list -1 $tag) && GIT_COMMITTER_DATE="$(git show $COMMIT_HASH --format=%aD | head -1)" git tag -a -f $tag -m"$(git show $COMMIT_HASH --format=%s | head -1)" $COMMIT_HASH ; done && git push --tags --force

How to change a commit timestamp

20 September 2018

You may need to change the DateTime of a commit in some situations. For example, some countries use daylight saving time period and because of it, some of the commits can have the wrong timestamp.

git commit --amend --date "Thu Feb 15 22:37:31 2018 +0300"

Upgrading Ubuntu Server LTS from 16.04 to 18.04

13 May 2018

Ubuntu 18.04, aka Bionic Beaver, was released on 26 April 2018. In this post, I will try to explain how do I upgrade my Ubuntu server. I will also inform you about how I overcome the obstacles related python hosting.