{"id":26691126,"url":"https://github.com/olahsymbo/handy-commands","last_synced_at":"2026-04-15T05:32:08.576Z","repository":{"id":42498071,"uuid":"394247242","full_name":"olahsymbo/handy-commands","owner":"olahsymbo","description":"some helpful commands while developing an application or working on a server","archived":false,"fork":false,"pushed_at":"2023-03-17T08:57:05.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T16:17:24.376Z","etag":null,"topics":["cloud","database","ec2-instance","git","linux","postgres","remote-ssh","shell","virtualenv","vscode"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olahsymbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-09T10:27:34.000Z","updated_at":"2023-03-17T08:58:13.000Z","dependencies_parsed_at":"2023-01-17T20:16:19.897Z","dependency_job_id":null,"html_url":"https://github.com/olahsymbo/handy-commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olahsymbo/handy-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olahsymbo%2Fhandy-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olahsymbo%2Fhandy-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olahsymbo%2Fhandy-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olahsymbo%2Fhandy-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olahsymbo","download_url":"https://codeload.github.com/olahsymbo/handy-commands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olahsymbo%2Fhandy-commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","database","ec2-instance","git","linux","postgres","remote-ssh","shell","virtualenv","vscode"],"created_at":"2025-03-26T16:17:26.998Z","updated_at":"2026-04-15T05:32:08.557Z","avatar_url":"https://github.com/olahsymbo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# handy-commands\n\n## Banish .idea from repo\n\n```\nfind . -name .idea -print0 | xargs -0 git rm -r -f --ignore-unmatch\necho .idea \u003e\u003e .gitignore  \ngit add .gitignore  \ngit commit -m '.idea banished!'\ngit push\n```\n\n## Select python version for a virtualenv\n\n`virtualenv -p /usr/local/opt/python@3.7/bin/python3.7 ocrenv`\n\nyou can change `python@3.7` assuming you have multiple versions. \n\n\n## Alternative python version selection method\n\n```\npyenv install 3.7.9\n\npyenv local 3.7.9\n```\n\n## Set up pipenv\n\n```\npip --version \npip install --user pipenv \npython -m site --user-base \nexport PATH=\"$PATH:/home/olasimbo/.local/bin\" \nsource ~/.bashrc\n```\n\n## Proper checkout/merge branch\n\n`git checkout dev \u0026\u0026 git pull` \n\nthen merge `dev` branch into your branch locally \n\n`git checkout feature/CGP-3 \u0026\u0026 git merge --no-ff dev`\n\nthen do `git push` to update `feature/CGP-3`\n\n\n## Get server ip\n\n`ipconfig getifaddr en0`\n\nor \n\n`server_ip = requests.get('http://ipconfig.in/ip').text`\n\n\n## Add your ssh key to cloud VM authorized keys\n\n```\ncat ~/.ssh/id_rsa.pub | sudo ssh -i /path/to/pem_or_key user@ipaddress \"mkdir -p ~/.ssh \u0026\u0026 cat \u003e\u003e ~/.ssh/authorized_keys\"\n```\nyou can then connect to VM directly from VScode remote-ssh or from local terminal\n\n\n## Using VSCode Remote-SSH with Ubuntu/Linux server\n\nFirst add Remote-SSH under extension in VSCode, then edit your `.ssh` config file with the following and save it\n\n```\nHost *\nServerAliveInterval 30\nServerAliveCountMax 6\n\n\nHost project-name\n    HostName server-ip\n    User ubuntu\n    IdentityFile /path/to/pem\n```\nIncase you already copied your local ssh to cloud VM authorized keys, then you can omit IdentityFile (not needed)\n\n\n## Copy files to server\n\n```\nrsync -PrlptD ~/Documents/hor/AnnotatedData/untitled_folder ubuntu@ipaddress:/home/ubuntu/hor/csv_tmp \nrsync -I -PrlptD ~/Documents/hor/json_tmp ubuntu@ipaddress:/home/ubuntu/hor/json_tmp\n```\n\n## Creating postgres DB\n\n```\nsudo -u postgres psql\ncreate database mydb;\ncreate user myuser with encrypted password 'mypass';\ngrant all privileges on database mydb to myuser;\n```\n\n\n## Alter Role on DB\n\n```\nALTER USER role SUPERUSER CREATEDB CREATEROLE;\n```\n\n## Drop DB\n\n``` \nsudo -u postgres dropdb databasename\n```\n\n\n## Network Issues \n\n# OCI Linux Server\n\nFor issues with making requests to a linux server on OCI, set these options for the ports:\n\n```\nsudo firewall-cmd --zone=public --permanent --add-port=5005/tcp \n\nsudo firewall-cmd --reload\n```\n\n# OCI Ubuntu Server\n\nFor ubuntu:\n\n```\nsudo iptables -I INPUT 6 -p tcp --dport 5010 -j ACCEPT \n\nsudo netfilter-persistent save\n```\n\nor use\n\n```\nsudo ufw allow 22\nsudo ufw allow your-port\nsudo ufw enable\n```\nFirst ensure port 22 is opened, open your preferred port (e.g 5010), then enable the firewall (select `y`). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folahsymbo%2Fhandy-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folahsymbo%2Fhandy-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folahsymbo%2Fhandy-commands/lists"}