Skip to content

Instantly share code, notes, and snippets.

View weshayutin's full-sized avatar

Wesley Hayutin weshayutin

View GitHub Profile
@weshayutin
weshayutin / tmux-cheatsheet.markdown
Last active October 18, 2019 16:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

settings

bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
@weshayutin
weshayutin / move_bugs.py
Created September 26, 2019 16:58 — forked from mwhahaha/move_bugs.py
tripleo-move-bugs
#!/usr/bin/env python
from __future__ import print_function
# Example usage:
# python move_bugs.py --no-dry-run --priority-less-than High tripleo stein-3 train-1
# python move_bugs.py --no-dry-run tripleo stein-3 stein-rc1
# python move_bugs.py --no-dry-run --priority-less-than High tripleo stein-rc1 train-1
# python move_bugs.py --no-dry-run --priority-less-than Critical tripleo stein-rc1 train-1
# python move_bugs.py --no-dry-run tripleo stein-rc1 train-1
import argparse
# virsh net-list
# virsh net-info default
# virsh net-dhcp-leases default
Comprehensive Python Cheatsheet
===============================
<sup>[Download text file](https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md)
or [Fork me on GitHub](https://github.com/gto76/python-cheatsheet).
</sup>
![Monty Python](web/image_888.jpeg)
Main
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
if (it =~ /deploy-to/) {
q.cancel(it.task)
}
}
whayutin•OPENSTACK/elastic-recheck/queries ᐅ cat test.yaml [virtualenv] master ⚡ thinkdoe ⌚ 6:58:00
query: >-
message:"Failed connect to mirror.us-west-1.packethost.openstack.org" AND
tags:"console"
========= RESULT =============================
whayutin•OPENSTACK/elastic-recheck/queries ᐅ elastic-recheck-query test.yaml [virtualenv] master ⚡ thinkdoe ⌚ 6:57:14
@weshayutin
weshayutin / gist:d3d3bd6b6ebdc8bde930acbdc4f4e15e
Created May 16, 2018 19:52
Find errors in a linux system quickly
grep -rE '^[-0-9]+ [0-9:\.]+ [0-9 ]*ERROR ' /var/log/ |
sed "s/\(.*\)\(20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]\+\)\(.*\)/\2 ERROR \1\3/g" > /tmp/errors.txt;
mv /tmp/errors.txt /var/log/extra/errors.txt
Clear keypairs and stacks https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/ovb-manage-stack/templates/cleanup-stacks-keypairs.sh.j2
Delete a specific stack https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/ovb-manage-stack/tasks/ovb-delete-stack.yml
# Clear all the stacks #############################################################
ALL_STACKS=$(openstack stack list | grep "COMPLETE\|CREATE_FAILED" | cut -d '|' -f 3)
echo $ALL_STACKS
for STACK in $ALL_STACKS; do
echo "Deleting Heat stack $STACK"
@weshayutin
weshayutin / gist:8504cdb66a5db3bb7c6b1b4c30561d13
Created September 29, 2017 21:05 — forked from jimleitch01/gist:cf844a5d78f97073539d
Script to delete and re-create openstack users and networks
#!/bin/bash
#Script to delete and re-create openstack users and networks
. ~/keystonerc_admin
echo "================"
echo "running $0"
echo "About to really clean up, type "yes" to continue"
read CONTINUE
(undercloud) [stack@undercloud ~]$ openstack catalog show heat
+-----------+-----------------------------------------------------------------------------+
| Field | Value |
+-----------+-----------------------------------------------------------------------------+
| endpoints | regionOne |
| | publicURL: https://192.168.24.2:13004/v1/c75168f792154ee2a4b34cf76414ab20 |
| | internalURL: http://192.168.24.3:8004/v1/c75168f792154ee2a4b34cf76414ab20 |
| | adminURL: http://192.168.24.3:8004/v1/c75168f792154ee2a4b34cf76414ab20 |
| | |
| name | heat |