Skip to content

Instantly share code, notes, and snippets.

View tonyskapunk's full-sized avatar
🚀

Tony Garcia tonyskapunk

🚀
View GitHub Profile
Antes:
1 - #linux_mx: ban *!*jb@unaffiliated/jebus [by adams.freenode.net, 2495219 secs ago]
*2 - #linux_mx: ban *!*@189.238.179.202 [by adams.freenode.net, 2495219 secs ago]
3 - #linux_mx: ban *!*jebus*@* [by adams.freenode.net, 2495219 secs ago]
*4 - #linux_mx: ban *!*jebus@201.127.83.* [by adams.freenode.net, 2495219 secs ago]
5 - #linux_mx: ban *!*bba00294@*.187.160.2.148 [by adams.freenode.net, 2495219 secs ago]
*6 - #linux_mx: ban *!*BlouBlou@unaffiliated/bloublou [by adams.freenode.net, 2495219 secs ago]
7 - #linux_mx: ban *!*bba0ea2f@*.187.160.234.47 [by adams.freenode.net, 2495219 secs ago]
8 - #linux_mx: ban jebus!*@* [by adams.freenode.net, 2495219 secs ago]
*9 - #linux_mx: ban *!*dasda@unaffiliated/jebus [by adams.freenode.net, 2495219 secs ago]
@tonyskapunk
tonyskapunk / netcat
Created March 2, 2016 16:53
nc zero I/O
$ nc -vw1 google.com 443 </dev/null
Ncat: Version 7.00 ( https://nmap.org/ncat )
Ncat: Connected to 173.194.205.101:443.
Ncat: 0 bytes sent, 0 bytes received in 0.09 seconds.
@tonyskapunk
tonyskapunk / dist.sh
Created August 4, 2016 17:10
Tolkien Distribution Name
for letter in {A..Z}; do echo -n "${letter}":; links -dump http://www.behindthename.com/namesakes/list/tolkien/alpha|awk '/IMG/ {print $1}'| grep -c ^${letter}; done
A:100
B:83
C:28
D:45
E:60
F:59
G:70
H:63
I:28
@tonyskapunk
tonyskapunk / recaplog.md
Last active January 6, 2017 18:43
recaplog basic tests

Number of files in my test recap var log:

[root@gnu ~]# find /var/log/recap |wc -l
170580

Dry run

[root@gnu ~]# recaplog -n
2017-01-06 17:41:16+00:00 [INFO] --- Starting dry run ---
@tonyskapunk
tonyskapunk / test.md
Last active February 6, 2017 16:55
tables

Currently:

| | Installation | Configuration | Troubleshooting | Patching | | --- | --- | --- | --- | --- | --- | | Apache | Yes | Yes | Yes | Yes | | NGINX | Yes | Yes | Yes | Yes |

without bolds and centered:

| | Installation | Configuration | Troubleshooting | Patching |

[root@gnu recap]# cat recaplog.log
2017-03-03 17:02:56+00:00 [INFO] --- Starting run ---
2017-03-03 17:02:56+00:00 [INFO] Compressing old log files
2017-03-03 17:02:56+00:00 [INFO] Packing fdisk...
2017-03-03 17:02:56+00:00 [INFO] Moving 144 logs to: /var/log/recap/fdisk_daily_20170302
2017-03-03 17:02:56+00:00 [INFO] Compressing 144 logs into: /var/log/recap/fdisk_daily_20170302.log.tar.gz
2017-03-03 17:02:56+00:00 [INFO] Deleting 144 logs.
2017-03-03 17:02:56+00:00 [INFO] Packing mysql...
2017-03-03 17:02:56+00:00 [INFO] Moving 144 logs to: /var/log/recap/mysql_daily_20170302
2017-03-03 17:02:56+00:00 [INFO] Compressing 144 logs into: /var/log/recap/mysql_daily_20170302.log.tar.gz
@tonyskapunk
tonyskapunk / tests.md
Last active March 10, 2017 16:06
recaplog tests
  1. Without log compression and no logs available, dryrun
[root@gnu ~]# recaplog -n
2017-03-10 15:43:18+00:00 [INFO] recaplog (13279): Created lock file: /var/lock/recaplog.lock
2017-03-10 15:43:18+00:00 [INFO] --- Starting dry run ---
2017-03-10 15:43:18+00:00 [INFO] Not compressing old log files
2017-03-10 15:43:18+00:00 [INFO] Packing fdisk...
2017-03-10 15:43:18+00:00 [ERROR] An error ocurred while reading logs: 'ls: cannot access /var/log/recap/fdisk_20170309-*.log: No such file or directory', skipping...
2017-03-10 15:43:18+00:00 [INFO] Packing mysql...
2017-03-10 15:43:18+00:00 [ERROR] An error ocurred while reading logs: 'ls: cannot access /var/log/recap/mysql_20170309-*.log: No such file or directory', skipping...
@tonyskapunk
tonyskapunk / tests_examples.md
Created March 17, 2017 18:01
recap single DOTMYDOTCONF
  1. Using a non-valid config file:
2017-03-17_17:39:30
Error when attempting to read: /root/.my2.cnf,/root/.my2.cnf,/root/.my3.cnf, please check the DOTMYDOTCNF setting in the configuration file
  1. Using a valid config file with no spaces:
# cat "mysql.log_snapshot_2017-03-17_17:37:08"                                                                          
2017-03-17_17:37:08
@tonyskapunk
tonyskapunk / testing.md
Last active March 28, 2017 22:30
Testing PREFIX
  • Test 1 - Setting a PREFIX:
root@docker:/recap# make PREFIX=/tmp/other/usr install
Installing scripts...
Installing man pages...
Installing configuration...
Installing cron job...
Installing docs...
Creating log directories...
@tonyskapunk
tonyskapunk / help.md
Last active April 3, 2017 16:09
Docker

Updating images

The way of updating images is assuming you keep images based on a TAG

Before updating images make sure there are no images without a TAG, delete any that is not making use of one, see Removing old images down below.

images=$( docker images --format '{{ $image:=split .Repository "/" }}{{ index $image 1 }}:{{.Tag}}' )
for image in ${images}; do
  docker pull ${image}
done