Monday, May 23, 2016

Doing video screen capture with AndroidStudio and lbgdx games

I had to use these settings ...
... to get my video game to operate correctly when doing screen capture.

Friday, April 15, 2016

Setting root password for a Centos Cloud image

[red@vm-red ~]$ guestfish --rw -a ./CentOS-6-x86_64-GenericCloud-1508.qcow2 

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
><fs> list-filesystems
/dev/sda1: ext4
><fs> mount /dev/sda1 /
><fs> vi /etc/shadow

><fs> 


Note above not tested on Centos7

Tuesday, April 12, 2016

Listing Puppet Classes via REST API

As root on the puppet master execute this script:

[root@ost-puppet-el7-001 manifests]# cat list-classes.sh 
#!/bin/sh

PEFQDN=`hostname -f`
curl -X GET -H 'Content-Type: application/json' \
--cert /etc/puppetlabs/puppet/ssl/certs/${PEFQDN}.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/${PEFQDN}.pem \
--cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
https://${PEFQDN}:4433/classifier-api/v1/classes | python -m json.tool

Monday, February 01, 2016

Purging a file from a git repo


Step 1) Clone the repo.

Step 2) Remove the file from current repo.
$ git rm Documentation/master/rc.slack
$ git commit -m 'remove unneeded file'
$ git push origin uno_v0



Step 3) Purge the file


You need to run this command from the toplevel of the working tree.


$ git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch Documentation/master/rc.slack' --prune-empty --tag-name-filter cat -- --all




Note: the output:
WARNING: Ref 'refs/remotes/origin/uno_v0' is unchanged


That is why we needed to `git rm ...` and `git commit ...` and `git push ...` in Step 2.

Step 4) push the changes to the remote


$ git push -f --all origin


This will remove the file from all branches in the remote. However, if other people have cloned this repo and have a local copy of it, they either need to throw away the old copy and re-clone or rebase all of their branches to the new history, otherwise they will bring back the file when they merge/do pull requests.