Skip to content

Instantly share code, notes, and snippets.

View jhrcz's full-sized avatar

Jan Horacek jhrcz

View GitHub Profile
@jhrcz
jhrcz / initial-bash-history-on-wedos-vm.txt
Created December 4, 2017 21:22
initial-bash-history-on-wedos-vm
vim /etc/ssh/sshd_config
vi /etc/ssh/sshd_config
getenforce
vim /etc/selinux/config
vi /etc/selinux/config
sed '/^SELINUX=/ s/=.*/=disabled/' /etc/selinux/config
sed -i '/^SELINUX=/ s/=.*/=disabled/' /etc/selinux/config
yum updae
yum update
.%%...%%..%%%%%%..%%%%%....%%%%....%%%%..
@jhrcz
jhrcz / openalt-2017.md
Last active November 8, 2017 12:52
notes from openalt 2017

OpenALT 2017, poznamky a ...poznamky ;o)

SO

Petr Hráček: Testovaní modulů a kontaineru pomoci Meta-Test-Family

  • testovaci framework s decentnim popisem
  • moznost poustet instalaci modulu (ne rpm ale modulu z boltronu) a nasledne testu
  • moznost poustet ve vm, v kontejnerech, mezi vice vms
@jhrcz
jhrcz / docker-clean-wasted.sh
Created December 5, 2016 11:06
docker-clean-wasted
#!/bin/bash
set -xu
sudo docker ps -a | grep -i Exited | while read id rest ; do sudo docker rm $id ; done
sudo docker images | grep none | while read a b id rest ; do sudo docker rmi $id ; done
sudo docker volume ls -qf dangling=true | while read id ; do sudo docker volume rm $id ; done
@jhrcz
jhrcz / diff_file_with_rpm_content
Last active March 19, 2016 20:10
diff existing file with its original content from rpm
diff_file_with_rpm_content()
{
#
# EXAMPLES:
#
# diff_file_with_rpm_content /etc/sysconfig/somefile
# diff_file_with_rpm_content /etc/sysconfig/somefile.rpmsave /etc/sysconfig/somefile
#
@jhrcz
jhrcz / tmux-ansible.sh
Last active September 22, 2020 08:08
combining tmux, tmux-cssh and ansible - cluster ssh alternative with ansible inventory, uses https://github.com/dennishafemann/tmux-cssh
#!/bin/bash
login=root
grp="$1"
shift
tmux-cssh -u $login -sc `ansible ${grp:-all} -i ${CSSH_ANSIBLE_INVENTORY:-hosts.ini} --list-hosts` "$@"
@jhrcz
jhrcz / fix-abrt-missing-python-argparse.yml
Last active September 16, 2015 16:47
fix missing abrt dependency python-argparse
---
#
# i use this way to detect and report (as changed state) when its missing when running in --check mode
#
# it installs this package only when its the only package to install
# so i'm workarounding the problem of yum, could not install only one package
#
#
@jhrcz
jhrcz / README.md
Last active August 29, 2015 14:26
use interpreter like python based on script path

script has the same shebang in all cases. it depends on the path to the script which interpreter is used

no special environment setup, not additional wrappers, without changing shebang in scripts

just one configuration file/directory to specify which tool should use which environment. compatible with SCL, virtualenv and other available ways to get different version in one system

#!./python
@jhrcz
jhrcz / reformat-json-pipe.sh
Last active August 29, 2015 14:16
reformat-json-pipe
curl --header "PRIVATE-TOKEN: xxxx" "https://mygitlab/api/v3/projects/mynamespace%252Fmyproject" -s \
| python -msimplejson.tool
curl --header "PRIVATE-TOKEN: xxxx" "https://mygitlab/api/v3/projects/mynamespace%252Fmyproject" -s \
| python -c 'import sys; import simplejson as json; print json.dumps( json.loads( sys.stdin.read() ), sort_keys=False, indent=4); '
@jhrcz
jhrcz / gist:bf63826060de97cc156a
Created November 18, 2014 11:06
calculate listed files size with rsync
find /var/lib/jenkins/.m2/repository -type f -mtime +30 -print0 | rsync -n --stats -h --files-from=- --from0 / /tmp/none | grep "Total file size:"
Total file size: 11.26G bytes
@jhrcz
jhrcz / one-check-in-template-image-vs-image-owner.sh
Created August 26, 2014 22:01
one-check-in-template-image-vs-image-owner
#!/bin/bash
# cat | bash -ls
# cat | VERBOSE=YES bash -ls
while read tplid
do
[ -n "$tplid" ] || continue
[ "$VERBOSE" = "YES" ] \