[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-728":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},728,"hacker-scripts","NARKOZ\u002Fhacker-scripts","NARKOZ","Based on a true story","",null,"JavaScript",49550,6641,2043,37,0,35,50,81,114,45,false,"master",[],"2026-06-12 02:00:17","\nEnglish | [简体中文](.\u002FREADME.zh-CN.md)\n\n# Hacker Scripts\n\nBased on a _[true\nstory](https:\u002F\u002Fwww.jitbit.com\u002Falexblog\u002F249-now-thats-what-i-call-a-hacker\u002F)_:\n\n> 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> xxx: So we're sitting here, looking through his, uhm, \"legacy\"\n\n> xxx: You're gonna love this\n\n> xxx: [`smack-my-bitch-up.sh`](https:\u002F\u002Fgithub.com\u002FNARKOZ\u002Fhacker-scripts\u002Fblob\u002Fmaster\u002Fsmack-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> xxx: [`kumar-asshole.sh`](https:\u002F\u002Fgithub.com\u002FNARKOZ\u002Fhacker-scripts\u002Fblob\u002Fmaster\u002Fkumar-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> xxx: [`hangover.sh`](https:\u002F\u002Fgithub.com\u002FNARKOZ\u002Fhacker-scripts\u002Fblob\u002Fmaster\u002Fhangover.sh) - another cron-job that is set to specific dates. Sends automated emails like \"not feeling well\u002Fgonna 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> xxx: (and the oscar goes to) [`fucking-coffee.sh`](https:\u002F\u002Fgithub.com\u002FNARKOZ\u002Fhacker-scripts\u002Fblob\u002Fmaster\u002Ffucking-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> xxx: holy sh*t I'm keeping those\n\nOriginal: http:\u002F\u002Fbash.im\u002Fquote\u002F436725 (in Russian)  (Archive.org [link](https:\u002F\u002Fweb.archive.org\u002Fweb\u002F20210226092253\u002Fhttp:\u002F\u002Fbash.im\u002Fquote\u002F436725))\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 \u002Fpath\u002Fto\u002Fscripts\u002Fsmack-my-bitch-up.sh >> \u002Fpath\u002Fto\u002Fsmack-my-bitch-up.log 2>&1\n\n# Runs `hangover.sh` monday to friday at 8:45 am.\n45 8 * * 1-5 \u002Fpath\u002Fto\u002Fscripts\u002Fhangover.sh >> \u002Fpath\u002Fto\u002Fhangover.log 2>&1\n\n# Runs `kumar-asshole.sh` every 10 minutes.\n*\u002F10 * * * * \u002Fpath\u002Fto\u002Fscripts\u002Fkumar-asshole.sh\n\n# Runs `fucking-coffee.sh` hourly from 9am to 6pm on weekdays.\n0 9-18 * * 1-5 \u002Fpath\u002Fto\u002Fscripts\u002Ffucking-coffee.sh\n```\n\n---\nCode is released under WTFPL.\n","NARKOZ\u002Fhacker-scripts 是一个基于真实故事的脚本集合，用JavaScript编写，包含多个自动化处理日常任务的实用脚本。其核心功能包括通过短信自动向家人发送工作晚归通知、根据邮件内容自动恢复数据库备份以及定时发送健康状况不佳的工作邮件等。技术特点在于利用了环境变量配置和定时任务（cron jobs）来实现自动化操作，并且支持Twilio短信服务和Gmail邮箱接口。该项目适合需要提高工作效率或解决特定场景下自动化需求的技术人员参考使用。",2,"2026-06-11 02:38:55","top_all"]