Skip to content

Instantly share code, notes, and snippets.

View pulketo's full-sized avatar

Pulketo pulketo

View GitHub Profile
@pulketo
pulketo / gist:b85d205441c79f17febcba113cd51b71
Created January 8, 2019 22:56
List enabled / disabled services systemctl | Listar servicios habilitados / deshabilitados de systemctl
All | Todos
systemctl list-unit-files
Enabled | Habilitados
systemctl list-unit-files | grep enabled
Disabled | Deshabilitados
systemctl list-unit-files | grep disabled
@pulketo
pulketo / gist:9088a9f44e34a3f6e0017686dcb5bde0
Last active October 29, 2020 17:58 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
#!/bin/bash
#
# usage: ./genhaproxypem.sh domain.com
# Generate a unique private key (KEY)
sudo openssl genrsa -out $1.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key $1.key -out $1.csr
# Creating a Self-Signed Certificate (CRT)
@pulketo
pulketo / gist:8b119045ee175583ff176fe3a14e39e5
Created January 9, 2019 19:53
Delete empty lines with "sed" | Borrar lineas en blanco con "sed"
cat file.in | sed '/^$/d' >file.out
#
sed -i '/^$/d' file.in.place
@pulketo
pulketo / gist:42f680cd527089c5e5c3d87fc0edc7e1
Created January 11, 2019 18:16
Palette colors fonts etc
https://mycolor.space/gradient
http://paletton.com/
@pulketo
pulketo / gist:952c8d047244e7b6fe6c4215a0993da5
Created January 14, 2019 23:18
Ajustar zona horarioa | Set / Get timezone Centos 7
REVIEW: timedatectl list-timezones
GET: timedatectl status
SET: timedatectl set-timezone America/Mexico_City
@pulketo
pulketo / gist:dd916561c367cfe5b2baac3b4d049e76
Created January 16, 2019 15:27
Cosas con docker | docker stuff
Actualizar una imagen (p.ej myssql)
docker pull mysql
docker stop my-mysql-container
docker rm my-mysql-container
docker run --name=my-mysql-container --restart=always -e MYSQL_ROOT_PASSWORD=mypwd -v /my/data/dir:/var/lib/mysql -d mysql
show current docker images running
docker ps
show last images running and stopped
remove first column
cat stuff.txt | awk '{$1=""}1' | awk '{$1=$1}1'
remove empty lines
cat stuff.txt | sed '/^$/d'
sed -i '/^$/d' stuff.txt
WebServer alternatives:
h2o: https://h2o.examp1e.net/configure/fastcgi_directives.html#fastcgi.connect
gwan:
lwan:
Json Restful Storage Engine:
https://kronuz.io/Xapiand/docs/quickstart/
FB PHP login:
https://github.com/justfede/php-simple-facebook-login
WP
https://docs.woocommerce.com/document/handle-multiple-regions-currencies-woocommerce/
@pulketo
pulketo / Lubuntu, add new font | agregar font
Last active January 24, 2019 16:13
Lubuntu, add new font | agregar font
put'em on: /usr/share/fonts/truetype/
sudo fc-cache -f -v
@pulketo
pulketo / extractNumbersString.php
Created January 31, 2019 17:12 — forked from lerua83/extractNumbersString.php
PHP - Extract numbers from a string: URL: http://stackoverflow.com/questions/6278296/extract-numbers-from-a-string I want to extract the numbers from a string that contains numbers and letters like
$str = 'In My Cart : 11 12 items';
preg_match_all('!\d+!', $str, $matches);
print_r($matches);