Posts

htop

Htop is super easy to use

Linux top is very useful in seeing system processes. The only problem is the general layout and commands are not obvious while its open. For those reasons, I like htop (htop – interactive process viewer). It lists many options on the bottom of the screen and you can press the letter h to get more detailed information. Once in the application, you can press f5 to activate tree view or you can press the period key to change the sorting column. I also use the f4 key a lot to activate the search functionality. HTop is definitely a must-have application

 

In a Debian based Linux distro like Ubuntu, Gnome, Kubuntu and plenty more just run this comment below which will install it because htop is not installed by default.

sudo apt install htop -y;

 

Some resources:

Timesaving tips for programming
To save time, lots of people will say they have code repositories where they can easily pop in what they need. That’s not always true or the most functional way to program. I have put together a few things that I use almost daily to help save minutes here and there.

to me, notes could be:

  • searchable
  • be able to track revisions
  • be easy to use

for those reasons, I like to use a self-hosted wiki called DokuWiki, it’s free and powerful with lots of plugins and its super lite and easy to use.

Dokuwiki logo

Software Toolbox, just a few things that I use to help productivity.

phpstorm logo


I have a kind of large toolbox of software and tricks I like to use.
Some software I use A LOT:
  • kruler free on-screen pixel ruler
  • gcolor2 easy on-screen color selector
  • shutter super awesome screenshoting tool
  • PHPStorm as my ide, and a few terminal alias and scripts.

Utilize aliases and scripting when possible.

On my current project, we use Jira, which is great, but all the word we do is in feature branches. The branch name is something like Zach/bug/st-111-i-am-doing-something, and after creating the feature branch we mark the task as in development, assign ourselves, yadda yadda. So, I took an hour and scripted all that stuff. I’m not saving hours at a time by doing that. But, just consider the collective time over years of working on this project, it’ll add up. in my aliases file for my terminal I’ve added a few things that I’ll add below

This file is a little messy but it shows the point:

alias art=”php artisan”
alias codecept=”php vendor/bin/codecept”
# Enable debugger in phpstorm
alias debug=”export XDEBUG_CONFIG=\”idekey=PHPSTORM\””
# copying commands
alias rsync=”rsync -hrltiSmP”
alias dd=”dd status=progress”
alias ai=”sudo apt install -y”
alias au=”sudo apt update”
alias ag=”au && sudo apt dist-upgrade”
alias a=”git add”
alias s=”git status”
alias stat=s
alias d=”git diff”
alias checkout=”git checkout”
alias ..=”cd ..”
alias …=”cd ../..”

Hand travel time

Probably the biggest thing you can do is consider travel time. The distance your Hands move during the workday between your mouse and keyboard. Whether it’s jumping to the mouse or backspace or some other random action. An un-optimized shortcut key like in PHPStorm ctrl alt l, to format text when something like ctrl alt z would be easier for your left hand to quickly reach all the keys.
So, learning and customizing your shortcut keys will probably save you the most time in anything.
After shortcut keys, you’ll need to script what you can. Scripting can include system aliases and quick commands.
Another, for probably most of us, customize your system colors and fonts. The easier you can read code the better. By doing this the system will feel for intuitive and your eyes will be drawn to the different sections of the screen

Reduce backspacing and redundant typing

For all operating systems, you can download system-wide macros. These are even driven events that allow you to tell the computer what to do when you type or do something. Like on my computer I auto replace the lowercase i with a capital one I also replace ~addr with my full address, to show a few basic examples. In coding, you can use this to store common coding fragments or in some cases, you can create most of your code with a few simple keywords

I like to use autokey, but, I’m on Linux for other operating systems you may need to look for a good one. I think for windows you have AutoHotkey

My last and probably biggest tip

Take breaks, your mind needs time to relax and subconsciously process what you’re working on. Sometimes when I’ve tried to fix something for hours the best thing I can do is let the problem sit until the morning and BOOM within minutes I usually get it. It’s like my mind works on the problem all night or something. When you’re tired you tend to make a lot of mistakes you would not normally make. I have worked with a lot of people over the years and nobody(with a VERY few minor exceptions) can work great tired.

So while you are working on a problem subconsciously work on another simpler problem if you can/ have the time or just take a nap!

Good luck, let me know what you do to save some time. I’m always looking for more things to do to optimize my work day

Linux Rename

Rename!

there’s a really cool terminal command called “split” if you have to break up a large CSV file, such as something like a million rows, into separate files with 100k rows in each, you can just run something like
split thefile.csv -d –lines=”100000″
-d uses a numeric file increment instead of letters
from what I can tell this method will remove the file extension but you can use another terminal command called “rename” something like this should do it
rename ‘s/&/.csv’ the file* .

Useful links:

  • http://man7.org/linux/man-pages/man1/rename.1.html
  • https://linux.die.net/man/1/split