This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Lista paises facturas afip | |
// @namespace http://your.homepage/ | |
// @version 0.1 | |
// @description Agregar lista de paises a la generación de factura de afip | |
// @author Hugo Mauricio Prado Macat | |
// @match https://serviciosjava2.afip.gob.ar/rcel/jsp/genComDatosReceptor.do | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the file whoami.php should be placed in http://someserver/ with this content: | |
# <?php echo $_SERVER['REMOTE_ADDR']; | |
function do100tor() { | |
for i in {1..100} | |
do | |
tor > /dev/null 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# use like this: | |
# cd <yourmagentodir>; php -f isssues.php | |
$files = `find . -type f -iname "config.xml"`; | |
$files = explode("\n", trim($files)); | |
foreach ($files as $file) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function test(tablename text) RETURNS void as $$ | |
DECLARE | |
r text; | |
BEGIN | |
raise notice 'reading from: %', tablename; | |
FOR r IN execute ('SELECT sid FROM ' || tablename) | |
LOOP | |
-- can do some processing here | |
raise notice 'sid readed: %', r; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# see https://lebkowski.name/docker-volumes/ | |
# The command doesn’t remove anything, but simply passing the results to xargs -r rm -fr does so. | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( | |
docker ps -aq | xargs docker inspect | jq -r '.[]|.Mounts|.[]|.Name|select(.)' | |
) | |
# Hint: docker 1.9 has new volume management system, so it’s way easier with this version: | |
# docker volume ls -qf dangling=true | xargs -r docker volume rm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# requires: imagemagik, xdotool, xwininfo | |
# usage: click-by-image [image-file-to-search] [window partial title] [section x] [section y] [section width] [section height] | |
# section parameter is to cut the image of the window and make imagemagik faster | |
image_file=$1 | |
window_title=$2 | |
section_x=$3 | |
section_y=$4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: | |
# git addmodified | |
git add $(git status --porcelain | awk '/^.M/{print $2}') | |
# New command for adding only modified files to stage | |
# save it with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat <<EOF > /usr/local/etc/icinga-crontabs.sh | |
#!/usr/bin/env bash | |
function cleanup-dir() { | |
rm -Rf /icinga/crontabs | |
mkdir -p /icinga/crontabs | |
chmod -R 444 /icinga/ | |
chmod 555 /icinga /icinga/crontabs | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires (on ubuntu: apt-get install -y debootstrap) | |
thisdir=./squeeze-distro | |
# create chroot system | |
# debootstrap stable ${thisdir} http://ftp.us.debian.org/debian | |
debootstrap --arch i386 squeeze ${thisdir} http://archive.debian.org/debian/ | |
# mount devices | |
dirs=(/dev /dev/pts /dev/shm /tmp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a fully automated script to configure an openvpn server and create the config for one user | |
# tested only on ubuntu | |
# Configurar un Servidor OpenVPN en Ubuntu 16.04 | |
# from https://www.digitalocean.com/community/tutorials/como-configurar-un-servidor-openvpn-en-ubuntu-16-04-es | |
server_name="NY-DO" | |
client_1=mauricio | |
port=443 | |
server_ip=$(dig +short myip.opendns.com @resolver1.opendns.com) |
OlderNewer