Skip to content

Instantly share code, notes, and snippets.

View SathyaBhat's full-sized avatar
🎶

Sathyajith Bhat SathyaBhat

🎶
View GitHub Profile
@SathyaBhat
SathyaBhat / gist:894012
Created March 30, 2011 07:36
Chrome extensions keyboard shortcut handler
/*
Right here's the thing - for keyPress events to be run, you'll have to make use of
content scripts. Content scripts handle things at webpage & DOM level. You'll have
to do changes to your manifest:
*/
------------------------
manifest.json:
------------------------
/*
Note: don't replace manifest.json, add the relevant changes else
@SathyaBhat
SathyaBhat / gist:e0da09d9214b46551c3a98dce46a710e
Created April 18, 2023 04:54
Filtering logs in CloudWatch Log Insights
fields @timestamp, @message, @logStream, @log
| filter @message not like /RequestId|Verbose|INIT_START|Importing/
| sort @timestamp desc
@SathyaBhat
SathyaBhat / fixperms.bat
Created May 14, 2011 07:25
fix permissions for "You need permissions from .. to perform this action" in Windows 7
takeown /r /d y /f *
icacls * /reset /t /c /q
@SathyaBhat
SathyaBhat / am.tmpl
Last active July 2, 2020 14:10
Iterate through all common annotations and labels in AlertManager templates
*Common Annotations*
{{ range .CommonAnnotations.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
{{ end }}
*Common Labels*
{{ range .CommonLabels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
{{ end }}
@SathyaBhat
SathyaBhat / gist:4405270
Last active December 10, 2019 15:37
Hotot filter list
###keywords
#pakvsind, #indvpak, #indvspak, daughters, rape, protest, politician, politics, shame, braveheart, #delhiProtests, greig, government, #DelhiRapists, cricket, Dhoni, obama, #cfc, #liverpool, #manutd, #mufc, liverpool, #vishwaroop, apple, ipad, bcci, #udrs, raw, #tamilbands, #afzalguru, #oppositefootballernames, Kejriwal, #AAP, #QuitAAP, Tharoor, Feku, Fekus, BJP, BDUTT, Gandhi, NaMo, Modi, KejriwalDharna, #UnitedWithAAP, #udrs, #tamilbands, #afzalguru, #oppositefootballernames, #indvspak, #ct, #iambesharam, football, cfc, moyes, feku, kejri, arsenal, #arsenal, afridi, IPL, IPL7, Robin, #PepsiIPL
###sources
world community grid, unfollowers.me, ask.fm, fllwrs, justunfollow, youversion
@SathyaBhat
SathyaBhat / mysqldump
Last active March 14, 2019 07:19
MySQL Compressed Backup
mysqldump -u <user> -p -h <host> --databases <db name> | gzip > <file>
@SathyaBhat
SathyaBhat / docker-compose.yml
Created August 30, 2018 13:24
Docker compose for drone
version: '3.5'
services:
drone-server:
image: drone/drone:0.8
ports:
- 80:8000
- 9000:9000
volumes:
- dronedata:/var/lib/drone
restart: always
@SathyaBhat
SathyaBhat / kops.sh
Last active March 18, 2018 01:51
Bring up kops cluster
#!/bin/bash
aws iam create-group --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops
aws iam create-user --user-name kops
stairs = input("Paste your input")
n = 0
position = 0
for s in stairs:
position += 1
if s == '(':
n += 1
elif s == ')':
n -= 1
if n == -1:
@SathyaBhat
SathyaBhat / vim-bufdo
Last active April 13, 2017 09:14
vim bufdo example
Snippet to replace a sentence across multiple buffers in Vim. The `update` writes the changes to the file.
bufdo %s/depends 'mysql2_chef_gem', '\~> 1.0.1'// | update