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
# Faster with dig | |
dig -4 +short myip.opendns.com @resolver1.opendns.com # -4 needed to force ipv4 connectivity as resolver1.opendns.com doesn't return any result for this over ipv6 | |
dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"' # IPv4 | |
dig -6 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"' # IPv6 | |
# Slower with curl | |
curl -4 https://diagnostic.opendns.com/myip | |
curl -6 https://diagnostic.opendns.com/myip | |
curl -4 https://icanhazip.com | |
curl -6 https://icanhazip.com |
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/perl | |
# | |
# Quick & dirty tool to generate fb.modes file from xorg detected valid modes. | |
# Just a way to avoid boring myself to death by manually generating modelines | |
# to convert them later to fb.modes with modeline2fb | |
# | |
# First we generate a X logfile with detailed info and later convert it. | |
# | |
# Usage: | |
# X :1 -logverbose 6 |
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 | |
# | |
# Copyright (c) 2014 Jorge Nerín <[email protected]> | |
# Last updated on: Jun/26/2014 by Jorge Nerín | |
# | |
############################################################################ | |
# | |
# .ovpn file generator (OpenVPN configuration files) | |
# | |
# It expects to find files with this names: |
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 | |
# Linked from: https://plus.google.com/+JorgeNer%C3%ADn/posts/3zdnEnXFN7Z | |
# Some oneliners to explore the oom_score* values: | |
# Processes with oom_score_adj != 0: | |
grep . /proc/*/oom_score_adj | grep -v ":0" | grep -v self | perl -ne 'm@/([0-9]+)/oom_score_adj:(-?[0-9]+)@; ($pid,$score)=($1,$2); open FILE,"<","/proc/$pid/cmdline"; $cmd=<FILE>; $cmd=~s/\0.*//; close FILE; print "$score\t$pid\t$cmd\n"; ' | |
# In my system the results sumarized are: | |
# adj name |
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 | |
RESOLUTIONS="1 1.25 1.3 1.5 2 3" | |
BASEDPI=96 | |
INFILE="image.jpg" | |
OUTFILE="image.svg" | |
WIDTH_AT_1DPPX=88 | |
IMAGE_TEMPLATE="$(basename $INFILE .jpg)_small" | |
cat > $OUTFILE <<EOF |
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 | |
# | |
# Script to automatically scan consecutive pages and OCR them | |
# | |
# Dependencies: | |
# scanimage from SANE | |
# convert from imagemagick | |
# tesseract for OCR | |
# | |
# But they are easy to replace |