{"id":16970143,"url":"https://github.com/mraza007/til","last_synced_at":"2025-09-03T07:38:59.785Z","repository":{"id":130317703,"uuid":"335491022","full_name":"mraza007/til","owner":"mraza007","description":"Things I learn/discover on daily basis. ","archived":false,"fork":false,"pushed_at":"2021-08-22T01:45:21.000Z","size":1194,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T20:05:57.815Z","etag":null,"topics":["linux","programming","til"],"latest_commit_sha":null,"homepage":"https://til-mraza007.vercel.app","language":"HTML","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/mraza007.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-03T03:01:53.000Z","updated_at":"2021-10-22T06:29:58.000Z","dependencies_parsed_at":"2023-05-07T05:33:46.727Z","dependency_job_id":null,"html_url":"https://github.com/mraza007/til","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mraza007%2Ftil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mraza007%2Ftil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mraza007%2Ftil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mraza007%2Ftil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mraza007","download_url":"https://codeload.github.com/mraza007/til/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248498090,"owners_count":21114036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["linux","programming","til"],"created_at":"2024-10-14T00:27:30.427Z","updated_at":"2025-04-12T00:21:19.287Z","avatar_url":"https://github.com/mraza007.png","language":"HTML","readme":"# TIL (Things I discover Linux/Programming/Automation)\n\n\n# Linux\n\nxargs -n 1 curl -sL \u003c 2018.txt | grep -Eo \"\u003ctitle\u003e.*\u003c/title\u003e\" The command to extract links using curl\n\ncurl -sL https://news.ycombinator.com/item\\?id\\=18740939 | grep -Eo 'href=\"(https|http):[^\\\"]+\"' Command to extract the links from hackernews\n\ngrep -aEo \"\u003ctitle\u003e.*\u003c/title\u003e\" -a option process binary file [link to sol](https://unix.stackexchange.com/questions/335716/grep-returns-binary-file-standard-input-matches-when-trying-to-find-a-string)\nuse ``` backticks to run a command in bash\n\n-\n\n- We can use this command to generate a `grub` configuration file, `sudo grub-mkconfig -o /boot/grub/grub.cfg`,As, `grub-mkconfig` scans hardrives for bootable operating systems such as windows,mac or linux distros\n\n- To open workspaces on specific windows when using `i3` window mananger use the following `assign [class=\"\u003cuse your program name here e.g. - Firefox\u003e\"] $workspace\u003ceg. 5\u003e` and refresh `i3-msg reload`\n\n- In order to resize images using command you can use the `convert` command. \n`convert img.jpg -resize 200x200 img-1.jpg` and you can also convert to different extenstions using `convert` command. `convert img.png img.jpg`\n\n- To add a printer on linux use `CUPS` web admin `http://localhost:631/`\n\n- `fuser -k \u003cport_name\u003e/tcp` use `fuser` to kill specific ports on linux\n\n- In order to save a file with root permission using vim you can do \n`:w !sudo tee %`\n\n- This commands `sudo netstat -plunt |grep post` outputs the port on which postgres db is running on\n\n- `chmod -x` allows you to revert the executable created by `chmod +x`\n\n- you can use `?*` to match the rest of the characters when moving the files \n\n\n\n## Git\n\nIn order to delete a branch on git locally you can use \n`git branch --delete \u003cbranchname\u003e` and if you want to do it remotely you can do `git push --delete \u003cbranchname\u003e`\n\nTo delete git commit history do the following\n- `git checkout --orphan \u003cbranch_name\u003e`\n- `git add -A`\n- `git commit --all -m \"a message\"`\n- `git branch -D \u003cdelete the main branch\u003e`\n- `git branch -m \u003crename the new branch to main branch\u003e`\n- `git push -f origin \u003cnew branch\u003e`\n\n\n## Python\n\njinja line break \n`{% autoescape false %} {{ org.backgroundInfo | replace(‘\\n’, ‘\u003cbr\u003e’) }} {% endautoescape %}`\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmraza007%2Ftil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmraza007%2Ftil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmraza007%2Ftil/lists"}