Skip to content

Instantly share code, notes, and snippets.

View mateothegreat's full-sized avatar
🤘
it ain't easy.

Matthew Davis mateothegreat

🤘
it ain't easy.
View GitHub Profile
@mateothegreat
mateothegreat / install.sh
Created October 5, 2018 19:53
Install MySQL Top (mtop) on RHEL/CentOS
#!/bin/sh
curl -L -O https://sourceforge.net/projects/mtop/files/mtop/v0.6.6/mtop-0.6.6.tar.gz
tar -xvzf mtop-0.6.6.tar.gz
rm -rf mtop-0.6.6.tar.gz
cd mtop-0.6.6
yum install -y perl-devel cpan perl-DBD-MySQL
cpan force install Curses
db.createUser({
user: "admin" ,
pwd: "password",
roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]
})
while true; do
mycommand &
last_pid=$!
sleep(60) // 60 seconds
kill -KILL $last_pid
const https = require('https')
const data = JSON.stringify({
someProp: 'some value'
});
const options = {
@mateothegreat
mateothegreat / awesome.component.ts
Last active February 14, 2019 11:36
Retrieve the hash value of a route (#myhash)
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-awesome',
templateUrl: './app-awesome.component.html',
styleUrls: [ './app-awesome.component.scss' ]
})
export class AwesomeComponent {
gcloud config get-value core/account
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole=cluster-admin \
--user=$(gcloud config get-value core/account)
cat test.json| jq 'to_entries[] | select(.value | index("group3") | not)'

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@mateothegreat
mateothegreat / ansible.cfg
Created April 25, 2020 20:35
ansible configuration for speed
[defaults]
host_key_checking = False
retry_files_enabled = False
ansible_python_interpreter=python3
localhost_warning = False
strategy_plugins = plugins/mitogen-0.2.9/ansible_mitogen/plugins/strategy
strategy = mitogen_linear
callback_whitelist = timer, profile_tasks
forks = 50
internal_poll_interval = 0.001