{"id":13394417,"url":"https://github.com/NARKOZ/hacker-scripts","last_synced_at":"2025-03-13T20:31:29.769Z","repository":{"id":37391430,"uuid":"46629305","full_name":"NARKOZ/hacker-scripts","owner":"NARKOZ","description":"Based on a true story","archived":false,"fork":false,"pushed_at":"2023-10-23T21:01:40.000Z","size":105,"stargazers_count":47496,"open_issues_count":67,"forks_count":6653,"subscribers_count":2097,"default_branch":"master","last_synced_at":"2024-10-13T18:08:36.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/NARKOZ.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},"funding":{"github":"NARKOZ","custom":"https://github.com/NARKOZ/SponsorMe"}},"created_at":"2015-11-21T19:05:09.000Z","updated_at":"2024-10-13T06:28:24.000Z","dependencies_parsed_at":"2022-07-06T13:02:45.258Z","dependency_job_id":"417a2db0-5b5f-4aa7-a3cb-26e060f713bd","html_url":"https://github.com/NARKOZ/hacker-scripts","commit_stats":{"total_commits":91,"total_committers":58,"mean_commits":"1.5689655172413792","dds":0.8461538461538461,"last_synced_commit":"b14a0a89bdf743c63ca4cc9cbcd866e050d7b3b0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NARKOZ%2Fhacker-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NARKOZ%2Fhacker-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NARKOZ%2Fhacker-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NARKOZ%2Fhacker-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NARKOZ","download_url":"https://codeload.github.com/NARKOZ/hacker-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243374245,"owners_count":20280660,"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":[],"created_at":"2024-07-30T17:01:18.654Z","updated_at":"2025-03-13T20:31:29.733Z","avatar_url":"https://github.com/NARKOZ.png","language":"JavaScript","readme":"\nEnglish | [简体中文](./README.zh-CN.md)\n\n# Hacker Scripts\n\nBased on a _[true\nstory](https://www.jitbit.com/alexblog/249-now-thats-what-i-call-a-hacker/)_:\n\n\u003e xxx: OK, so, our build engineer has left for another company. The dude was literally living inside the terminal. You know, that type of a guy who loves Vim, creates diagrams in Dot and writes wiki-posts in Markdown... If something - anything - requires more than 90 seconds of his time, he writes a script to automate that.\n\n\u003e xxx: So we're sitting here, looking through his, uhm, \"legacy\"\n\n\u003e xxx: You're gonna love this\n\n\u003e xxx: [`smack-my-bitch-up.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/smack-my-bitch-up.sh) - sends a text message \"late at work\" to his wife (apparently). Automatically picks reasons from an array of strings, randomly. Runs inside a cron-job. The job fires if there are active SSH-sessions on the server after 9pm with his login.\n\n\u003e xxx: [`kumar-asshole.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/kumar-asshole.sh) - scans the inbox for emails from \"Kumar\" (a DBA at our clients). Looks for keywords like \"help\", \"trouble\", \"sorry\" etc. If keywords are found - the script SSHes into the clients server and rolls back the staging database to the latest backup. Then sends a reply \"no worries mate, be careful next time\".\n\n\u003e xxx: [`hangover.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/hangover.sh) - another cron-job that is set to specific dates. Sends automated emails like \"not feeling well/gonna work from home\" etc. Adds a random \"reason\" from another predefined array of strings. Fires if there are no interactive sessions on the server at 8:45am.\n\n\u003e xxx: (and the oscar goes to) [`fucking-coffee.sh`](https://github.com/NARKOZ/hacker-scripts/blob/master/fucking-coffee.sh) - this one waits exactly 17 seconds (!), then opens a telnet session to our coffee-machine (we had no frikin idea the coffee machine is on the network, runs linux and has a TCP socket up and running) and sends something like `sys brew`. Turns out this thing starts brewing a mid-sized half-caf latte and waits another 24 (!) seconds before pouring it into a cup. The timing is exactly how long it takes to walk to the machine from the dudes desk.\n\n\u003e xxx: holy sh*t I'm keeping those\n\nOriginal: http://bash.im/quote/436725 (in Russian)  (Archive.org [link](https://web.archive.org/web/20210226092253/http://bash.im/quote/436725))\nPull requests with other implementations (Python, Perl, Shell, etc) are welcome.\n\n## Usage\n\nYou need these environment variables:\n\n```sh\n# used in `smack-my-bitch-up` and `hangover` scripts\nTWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nTWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n\n# used in `kumar_asshole` script\nGMAIL_USERNAME=admin@example.org\nGMAIL_PASSWORD=password\n```\n\nFor Ruby scripts you need to install gems:\n`gem install dotenv twilio-ruby gmail`\n\n## Cron jobs\n\n```sh\n# Runs `smack-my-bitch-up.sh` monday to friday at 9:20 pm.\n20 21 * * 1-5 /path/to/scripts/smack-my-bitch-up.sh \u003e\u003e /path/to/smack-my-bitch-up.log 2\u003e\u00261\n\n# Runs `hangover.sh` monday to friday at 8:45 am.\n45 8 * * 1-5 /path/to/scripts/hangover.sh \u003e\u003e /path/to/hangover.log 2\u003e\u00261\n\n# Runs `kumar-asshole.sh` every 10 minutes.\n*/10 * * * * /path/to/scripts/kumar-asshole.sh\n\n# Runs `fucking-coffee.sh` hourly from 9am to 6pm on weekdays.\n0 9-18 * * 1-5 /path/to/scripts/fucking-coffee.sh\n```\n\n---\nCode is released under WTFPL.\n","funding_links":["https://github.com/sponsors/NARKOZ","https://github.com/NARKOZ/SponsorMe"],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects","Uncategorized","HarmonyOS","其他_安全与渗透","others","Command line utilities scripts"],"sub_categories":["Uncategorized","Windows Manager","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNARKOZ%2Fhacker-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNARKOZ%2Fhacker-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNARKOZ%2Fhacker-scripts/lists"}