Skip to content

Instantly share code, notes, and snippets.

View AlexCallejas's full-sized avatar

Alex Callejas AlexCallejas

View GitHub Profile
@AlexCallejas
AlexCallejas / rootzilopochtli.txt
Last active November 30, 2017 02:04
diagrama
+--------------------------------+
| www.rootzilopochtli.com |
+----------------+---------------+
|
+------+ |
| +--------------+------------+
| | nginx reverse proxy |
| +--------------+------------+
| |
| +----------+-------+---+------------+
from os import path
from os import listdir
import re
import shutil
import datetime
source_dir = 'workdir'
dest_dir = 'newfiles'
def moveFile(filename, new_filename):
#!/bin/bash
for i in $(ls -1 workdir/); do echo $i| awk -F'.' '{ parte1=substr($1,1,17); parte2=substr($1,18,1); parte3=substr($1,19,18); parte2++ ;print "cp workdir/"$0,"newfiles/"parte1 parte2 parte3"."$2"."$3 }';done | bash
#!/bin/bash
for i in $(ls); do date1=$(echo "$i" | awk -F'[A-Z]' '{ print $1 }' | awk -F'2017' '{ print $2 }'); date2=$(echo $(echo "$i" | awk -F'[A-Z]' '{ print $1 }' | awk -F'2017' '{ print $2 }')+1 | bc); echo "$i : $date1 : $date2 : $(echo "$i" | sed s/$date1/$date2/)"; done
@AlexCallejas
AlexCallejas / InstallJBossonCentOS7.md
Last active March 28, 2018 03:29 — forked from Burning-Chai/InstallJBossonCentOS7.md
How to install JBoss on CentOS7
# yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
# java -version
java version "1.7.0_171"
OpenJDK Runtime Environment (rhel-2.6.13.0.el7_4-x86_64 u171-b01)
OpenJDK 64-Bit Server VM (build 24.171-b01, mixed mode)

# javac -version
javac 1.7.0_171
@AlexCallejas
AlexCallejas / jboss-as-standalone.sh
Last active March 27, 2018 22:13
JBoss standalone control script
#!/bin/sh
#
# JBoss standalone control script
#
# chkconfig: - 80 20
# description: JBoss AS Standalone
# processname: standalone
# pidfile: /var/run/jboss-as/jboss-as-standalone.pid
# config: /etc/jboss-as/jboss-as.conf
@AlexCallejas
AlexCallejas / git.io
Last active March 28, 2018 04:50
Git.io: GitHub URL Shortener
$ curl -i https://git.io -F "url=https://gist.github.com/darkaxl/d03da9585aabe10e14df29aa912155d8" -F "code=InstallJBossOnCentOS7"
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Server: Cowboy
Connection: keep-alive
Date: Wed, 28 Mar 2018 03:16:10 GMT
Status: 201 Created
Content-Type: text/html;charset=utf-8
Location: https://git.io/InstallJBossOnCentOS7
@AlexCallejas
AlexCallejas / gist:272b9bc394e68a115674fb25c3aa5aec
Last active May 22, 2019 17:41 — forked from msfjarvis/sepolicy.md
How to write sepolicy to fix a denial

Denial in question

avc: denied { read write } for pid=29059 comm="i.tetherservice" name="ipa" dev="tmpfs" ino=11991 scontext=u:r:system_app:s0 tcontext=u:object_r:ipa_dev:s0 tclass=chr_file permissive=0

sepolicy fix

allow system_app ipa_dev:chr_file {read write};

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@AlexCallejas
AlexCallejas / tmux.config
Created October 7, 2019 04:38
tmux.config
# https://gist.github.com/spicycode/1229612
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi