Unleashing Your Potential as a Developer with a Motor Disability: A Toolkit for Success
Maximizing Productivity and Efficiency as a Developer with a Motor Disability
With the right combination of tools and techniques, you can become an awesome developer.
As a developer with a motor disability, you may face unique challenges when it comes to productivity and efficiency. It’s important to find tools and strategies that work for you and your specific needs. In this article, we will discuss a range of strategies and tools that can help you streamline your work as a developer with any disability. From configuring SSH keys and work spaces with git, to creating aliases, working with Android and devices, using terminals effectively, and organizing your work with notebooks, we will cover a range of techniques that can help you improve your productivity and efficiency. Whether you are just starting out in your career as a developer or have been working in the field for a while, I hope you will find valuable insights and tips in this article.
The blog is divided into 5 sections:
- Maximizing Productivity with SSH Keys and Work Spaces using Git
- Boosting Productivity with Aliases
- Working with Android and Devices
- Optimizing Terminals and Workflows
- Organizing Your Work with Notebooks and Other Miscellaneous Tools
1. Maximizing Productivity with SSH Keys and Work Spaces using Git
Managing multiple accounts can be a challenge when working with different accounts. In this section, we will discuss how to use SSH keys and git to streamline this process, as well as how to configure work spaces (directories for each git project) to increase efficiency
1.1. SSH keys
SSH keys are used to authenticate you to the remote server. You can create a key pair for each account and use it to authenticate to the remote server. To create a key pair, you can use the following command:
# template
>ssh-keygen -t rsa -b 4096 -C "[email protected]" -f [rsa name]
# i.e.
>ssh-keygen -t rsa -b 4096 -C "rdominguez@boosttag.com" -f ~/.ssh/id_rsa_boosttag
This command will create a key pair in the .ssh directory. The private key will be named id_rsa, and the public key (*.pub file). You can use the following command to copy the public key to the clipboard:
>cat ~/.ssh/id_rsa_boosttag.pub | pbcopy
Now you can add the key to your GitHub/GitLab account or any other platform that supports it. To do this, go to the settings of your account, then to the SSH and GPG keys. You can add a new key and paste the public key in the key field. Now you can use the private key to authenticate to the remote server using the following command:
>ssh-add ~/.ssh/id_rsa_boosttag
This command will add the private key to the ssh agent.
1.2 Config Host and ssh files
Now we need to configure the ssh config file to use the private key when connecting to the remote server. To do this, add the following lines to the ssh config file:
// ~/.ssh/config
Host github
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host gitlab
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_rsa_boosttag
1.3. Git User config for multiple workspaces
Create a gitconfig file in your work space directory and add the following lines:
// workspace/.gitconfig i.e. boosttag/.gitconfig
[user]
name = Freddy Dominguez
email = rdominguez@boosttag.com
Finally, we need to tell git to change the user when you are working in a different folder. To do this, add the following lines to the gitconfig file:
// ~/.gitconfig
[user]
name = Romell D.Z. 福笛
email = rdominguez@boosttag.com
[includeIf "gitdir:/Volumes/Fudi OX/Dev/boosttag/"]
path = "/Volumes/Fudi OX/Dev/boosttag/.gitconfig"
...
[includeIf "gitdir:/.../any_other_workspace/"]
path = "/.../any_other_workspace/.gitconfig"
...
Thus, make sure that you have the same user in all your workspaces. Now when you change to a different workspace, git will automatically change the user to the one in the workspace. You can check the user with the following command:
git config user.name # display the current user name
git config user.email # display the current user mail
1.4. Yubico key for ssh
Yubico key is a hardware key that can be used to authenticate you to the remote server. To use it, you need to install/upgrade the openssh command. You can install it using the following command:
brew install openssh
Then you need to create a ssh key for Yubico:
# Create the key
ssh-keygen -t ecdsa-sk -C romllz489@gmail.com -f yubicoKey
# Next, add the key to the ssh agent
ssh-add -K yubicoKey
Finally, you need to add the public key to your account in the same way as you did for the regular SSH key:
# ~/.ssh/config
# Personal github account
Host github.com
HostName github.com
User git
IgnoreUnknown UseKeychain
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/yubicoKey
The above configuration will use the Yubico key to authenticate you to the remote server. When you try to connect to the remote server you will be asked to touch the physical key to authenticate you.
2. Boosting Productivity with Aliases
Aliases are shortcuts that allow you to execute a command with a different name or with different options.
2.1 Alias in bash terminals
You can create aliases in the bashrc. Just modify the file by openning bash_aliases file:
# In unix terminal
>code ~/.bash_aliases
# In cmder terminal
>code \cmder\config\user_aliases.cmd
Lets add some productivity aliases:
# Set an alias for the boosttag directory
alias boosttag='/Volumes/Fudi\ OX/Dev/boosttag'
# Disable the conda environment
alias non='conda deactivate'
# Disable and enable the "tensorflow" environment
alias tf='non; source ~/.bash_profile; conda activate tensorflow'
# Search a word or sentence in terminal log
alias h='history | grep --color=auto'
# Press the home button on Android devices
alias home='adb shell input keyevent KEYCODE_HOME'
# Connect to FireTV via WiFi IP
alias ftv='f() { adb connect 192.168.68.119; }; f'
# Display the device in the computer
alias mr='scrcpy -s {device_hash_name} -m1024 --always-on-top --disable-screensaver -S -w -t --shortcut-mod ralt'
# Record a video for testing in mp4 format
alias mp4='scrcpy -s {device_hash_name} -m1024 --record --disable-screensaver -w -t --shortcut-mod ralt $*'
# Take a screenshot
alias png='adb exec-out screencap -p > $*.png'
# Start Jupyter Lab server
alias jl='jupyter lab'
# Remove all build directories recursively created by IDE
alias cl_build='find . -type d -name build -exec rm -rf {} \;'
# Use croc command to send and receive data preventing proxy settings
alias cr='croc send --code idKeyword'
alias crc='croc --yes --overwrite idKeyword'
alias crt='croc send --code idKeyword --text'
You can invoke them, just running:
# Set custom prompt for 'boosttag' command
~$ boosttag
/Volumes/Fudi\ OX/Dev/boosttag$
# Activate TensorFlow environment with 'tf' command
~$ tf
~(tensorflow)$
# Search command history with 'h' and filter by keyword "git flow"
~$ h "git flow"
... ...
9808 git flow init
9809 git flow feature start doc
9813 git flow feature finish doc
9909 git flow feature december_photos
9910 git flow feature start december_photos
9911 git flow init
9912 git flow feature start december_photos
9915 git flow feature finish december_photos
# Go to home directory with 'home' command
~$ home
# Connect to remote device with 'ftv' command
~$ ftv
connected to 192.168.68.110:5555
# Execute Media Recorder with 'mr' command
~$ mr
~$ mp4 ticket_1234_issue_P345.mp4
# Execute PNG converter with 'mr' command
~$ png evidence_1234_issue
# Execute 'jl' command to display job list
~$ jl
# Execute 'cl_build' command to perform build process
~$ cl_build
# Send a file between computers using 'cr' command
~$ cr project_with_evidence.zip
# Receive the file on the other computer using 'crc' command
~/any_directory$ crc
Receiving 'project_with_evidence.zip' (0 B)
Receiving (<-192.168.68.112:9009)
100% |████████████████████| ( 0/ 3.5MB, )
~/any_directory$ ls
project_with_evidence.zip
# Send a string between computers using 'crt' command
~$ crt "https://github.com/romellfudi/medium"
# Receive the string on the other computer using 'crc' command
~/any_directory$ crc
Receiving text message (36 B)
Receiving (<-192.168.68.112:9009)
https://github.com/romellfudi/medium
You could create any alias for a long or complex command that you use frequently, such as building and running a particular application. This would allow you to simply type the alias rather than the entire command, saving you time and effort.
2.2 Alias in git
To create new alias for git, just need run the configuration file by running the command:
~$ git config --global --edit
Adding a basic alias to open git config file with your default editor:
# ~/.gitconfig
...
[alias]
al = config --global --edit
Next we need to save the file, and then you can use the alias to open the git config file:
~$ git al
As you can observe, the use of an alias is highly beneficial in opening the config file quickly . We will now proceed to add more useful aliases to git:
# ~/.gitconfig
# change branch
co = "!f() { git checkout \"$1\"; }; f"
# show list of commits of the current branch
ls = log --pretty=format:"%C(yellow)%h\\ %Creset%s%Cblue\\ [%cn]\\%Cred%d" --decorate
# show the remote url
url = config --get remote.origin.url
# show the list of commits of all branches in a tree graph
gh = log --all --decorate --oneline --graph
# push the the changes by remote and branch
pb = "!f() { git push -u \"$1\" \"$2\"; }; f"
# create a new tag with a message
tg = "!f() { git tag -a \"$1\" -m \"$2\"; }; f"
# merge a branch and delete it
me = "!f() { git merge \"$1\"; git branch -d \"$1\"; }; f"
In case you need a workflow of commands sequentially, just need add a function f between quotes, you can also pass attributes as parameters by using \"${number of attribute}\".
You are now able to utilize the following commands in your terminal:
>git co master
>git ls
>git url
>git gh
>git pb origin master
>git tg v1.0.0 "First release"
>git me feature/fix_ticket_123
You can even use external command to use it in your alias. For example, you can use the following command to show the sizes information with git-sizer:
# ~/.gitconfig
# show the sizes information of the current project
sz = "!f() { git-sizer --verbose; }; f"
Now you can use the sz alias in terminals:
>git sz
The previous command will yield the following results:
Processing blobs: 1420
Processing trees: 477
Processing commits: 76
Matching commits to trees: 76
Processing annotated tags: 0
Processing references: 5
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size | | |
| * Commits | | |
| * Count | 76 | |
| * Total size | 20.6 KiB | |
| * Trees | | |
| * Count | 477 | |
| * Total size | 225 KiB | |
| * Total tree entries | 4.60 k | |
| * Blobs | | |
| * Count | 1.42 k | |
| * Total size | 2.65 GiB | |
| * Annotated tags | | |
| * Count | 0 | |
| * References | | |
| * Count | 5 | |
| | | |
| Biggest objects | | |
| * Commits | | |
| * Maximum size [1] | 346 B | |
| * Maximum parents [1] | 2 | |
| * Trees | | |
| * Maximum entries [2] | 77 | |
| * Blobs | | |
| * Maximum size [3] | 61.8 MiB | ****** |
| | | |
| History structure | | |
| * Maximum history depth | 74 | |
| * Maximum tag depth | 0 | |
| | | |
| Biggest checkouts | | |
| * Number of directories [4] | 196 | |
| * Maximum path depth [4] | 7 | |
| * Maximum path length [4] | 248 B | ** |
| * Number of files [4] | 1.35 k | |
| * Total size of files [4] | 2.42 GiB | ** |
| * Number of symlinks | 0 | |
| * Number of submodules | 0 | |
[1] b015cb0547a122ef55450b3ae053b5e2a7a1230f (refs/stash)
[2] acaf71bdb6027e71c0e866b19e034e8c35a8552b (refs/heads/main:dir1)
[3] 180835bc1511e8206949abcecbd15ea7e72315f9 (refs/heads/main:dir2/notebook.ipynb)
[4] e494dd2004dbfb52dc5d6762d71bbc1ee8edcdd1 (refs/heads/main^{tree})
3. Android and Devices
Being a disability Engineer and having worked with Android for a long time, I have learned some tricks that I want to share with you. One usually has to work with different devices, and it is very important to have a good organization of the devices. I will show you how to organize your devices and how to use them in the best way.
Many of problem that always hears is the wire could be moved and losses the connection when you are debugging an important issue in the device. To solve this problem, you can connect to them just using the IP address, but it is very tedious to remember the IP address of each device. To solve this problem, you can use the following command to connect to the device using the name:
Firstly, we need to enable the tcpip ports using, connect to the device:
// enable tcpip
>adb tcpip 5555
// connect to android device
>adb connect 192.168.68.xxx;
connected to 192.168.68.110:5555
We can use alias to remember quickly the ip for each device:
// add an alias to the device in ~/.bash_aliases
alias tcpip='adb tcpip 5555' // enable the tcpip to connect usb
alias android_phone='tcpip; adb connect 192.168.68.xxa'
alias f_tv='tcpip; adb connect 192.168.68.xxb'
alias android_tv='tcpip; adb connect 192.168.68.xxc'
alias android_tablet='tcpip; adb connect 192.168.68.xxd'
alias kindle='tcpip; adb connect 192.168.68.xxe'
To use them, just need to invoke the alias like:
>android_phone
connected to 192.168.68.xxa:5555
>f_tv
connected to 192.168.68.xxb:5555
>android_tv
connected to 192.168.68.xxc:5555
>android_tablet
connected to 192.168.68.xxd:5555
After connecting to the device, you will be able to see it in the Android Studio devices list, which makes it easier to debug the application. You won’t need to ask anyone for help in connecting to the device, as you can do it yourself.
Note: Sometimes the devices shows as if they were offline so in case has this issue, just kill server and start again.
>adb kill-server
>adb start-server
4. Terminals and workflows
Terminals are essential tools, here are some tips to make your work with terminals more efficient. Install a great useful terminal depending on your operative system, I will recommend these two::
iTerm2 is a terminal emulator for macOS with additional features and functionality, including support for multiple terminal sessions within a single window and customizable color schemes, and often used with tools like zsh and oh-my-zsh.
Cmder is a console emulator for Windows with a Unix-like command-line interface and additional features such as tabbed windows and customizable color schemes. It is an alternative to the Windows Command Prompt.
Cmder and iTerm2 are terminal emulators for Windows and macOS, respectively, that offer a more sophisticated and feature-rich command-line interface for users. Both programs provide a number of features beyond those offered by the default terminal applications on their respective operating systems, including support for multiple terminal sessions within a single window, customizable color schemes, and integration with other tools and services. Both programs are widely used by devs to improve their productivity and enhance their command-line experience.
Another software enhancement is Fig.io, is a software enhancement that provides a seamless integration with your preferred terminal. It allows for real-time collaboration on workspaces, making it an excellent tool for data scientists and software engineers who frequently utilize various commands, aliases, and scripts. With an IDE-style autocomplete feature, Fig.io helps to improve efficiency and speed while working in the command line. It also offers enhanced collaboration capabilities for teams and is compatible with the most widely used terminals, shells, and IDEs.
5. Notebooks and miscellaneous
Notebooks are a great tool for organizing your work and documenting your progress. Here are some tips to make your work with notebooks more efficient. Use Jupyter notebooks for interactive programming and data analysis. Use markdown for formatting and documenting your work. Use git to version control your notebooks.
Always have a miscellaneous notebook and keep it up to date
Having a miscellaneous notebook when working on Jupyter notebooks is important because it allows you to keep track of any additional notes, ideas, or information that are not directly related to the specific Jupyter notebook you are working on. This can be useful for you and your thoughts, as well as for maintaining a clear and concise focus on the task at hand within the Jupyter notebook. Additionally, having a separate miscellaneous notebook can help to reduce clutter, remember lines quickly and minimize confusion within your codes, allowing you to more easily locate and access the relevant information you need.
Here I share with you a helpful Notebook for you.
To add a notebook to your account, follow these steps:
- Open Colab.
- Go to the settings.
- Select the ‘Site’ tab.
- Paste the URL of the notebook into the ‘Notebook URLs’ list.
- If the URL is a GitHub repository, you can use the external link by adding ‘github’ as a resource in the Colab URL. For example, to transform the GitHub URL https://github.com/romellfudi/medium/blob/main/ColabFeatures.ipynb to a Colab URL, you would add https://colab.research.google.com/github/ to the beginning of the URL, like this: https://colab.research.google.com/github/romellfudi/medium/blob/main/ColabFeatures.ipynb.
- Once you have added the URL to your account, you can access it for future use.
If you already have a notebook in your Google Drive, you can simply copy and paste the Colaboratory URL to access it.
Awesome, now we can use it in any environment or notebook by clicking "Code snippets":
Conclusion
Being a developer, you have the power to create amazing things and make a positive impact in the world. By investing in the right tools and workflows, you can streamline your work and achieve greater levels of productivity and efficiency. There are many strategies and techniques you can use to improve your workflow.
But remember, productivity and efficiency are not just about using the right tools. It’s also about finding what works best for you and your unique needs. With dedication, determination, and the right tools, you can overcome any challenge and achieve greatness in your work. Keep pushing forward and never give up on your dreams!
Don’t be afraid to experiment with different approaches and see what works best for you.
Thank you for being here, please comment down your views, if any mistakes found the article will be updated