certbot centos 7 route53 dns verification error

If you recently started to receive the following error while trying to renew your certificates


An unexpected error occurred:
ImportError: cannot import name PROTOCOL_TLS

the simplest fix is to downgrade your python-s3transfer package to version ‘python-s3transfer.noarch 0:0.1.13-1.el7.0.1’


yum downgrade python-s3transfer.noarch

Bulk convert mkv h264 to mkv hevc

A nifty script to convert every mkv or mp4 file on a folder from h264 to hevc ( h265 ) maintaining an acceptable quality, my gains were at least 60% reduction in file sizes but YMMV, dependencies are ffmpeg and mediainfo

Start by installing the dependencies.

For Centos 7:


yum install epel-release -y
yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm -y
yum install  mediainfo libmediainfo ffmpeg ffmpeg-devel -y

 

For Debian:


apt install mediainfo ffmpeg -y

 
Continue reading “Bulk convert mkv h264 to mkv hevc”

Setting the cpu governor to powersave on all cpus

Some of the time the ‘cpufreq-set’ command doesn’t work as expected and you need to run the command for every core on a system but if you have a lot of cores it gets tiring really fast.
The snippet bellow to run cpufreq-set once on every core of the system.

Create the file ‘/sbin/cpufreq-set-all’ with the following:


   #!/bin/bash
   MAX_CPU=$((`nproc --all` - 1))
   for i in $(seq 0 $MAX_CPU); do
       echo "Changing CPU " $i " with parameter "$@;
       cpufreq-set -c $i $@ ;
   done

 
Enable execution with:


chmod +x /sbin/cpufreq-set-all

Continue reading “Setting the cpu governor to powersave on all cpus”

Configuring Pulse-audio to use a remote server

Let’s Start with some definitions:
Server: The computer that receives the audio and have the speakers connected.
Client: The computer that generates the audio and send it via the network.
 
On the server side you’ll need to enable the ‘module-native-protocol-tcp’ pulse-audio module, this module usually is already installed by but for security reasons it comes as disabled by default.
You’ll also need to open port tcp/4713 on your firewall.
After that you need to copy the file ‘~/.pulse-cookie’ from the server to every client.
Now that you synced the pulse-cookie file choose your authentication method used by the ‘module-native-protocol-tcp’ and edit the file ‘/etc/pulse/default.pa’.
 
If you want to let anyone with the right pulse-cookie file to connect and send audio:


    load-module module-native-protocol-tcp auth-anonymous=1 

 
Or a more secure approach is authentication with pulse-cookie and IP address or Network, if you have multiple clientes you just need to input a list separated by a semicolon:


    load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;<CLIENT_IP_OR_CLIENT_NETWORK>

 
Continue reading “Configuring Pulse-audio to use a remote server”

Shell Script to get the network list by domain name

If you followed my guide HERE and HERE you might be wondering if there is no easier/more automated way of doing it, and in fact there is a simple script that you could build.


#!/bin/bash
if [ "$#" -eq 0 ]; then
  echo "Usage: ./${0}  [v4|v6]"
  exit 1
fi

FILTER="route"
if [ "$#" -eq 2 ]; then
  if [ "$2" == "v4" ]
  then
     FILTER="route:"
  fi
  if [ "$2" == "v6" ]
     then
         FILTER="route6:"
  fi
fi

WHOISSERVER="whois.radb.net"
IPN=$(dig +short $1 | head -1)
ASN=$( whois -h ${WHOISSERVER} ${IPN} | grep -i origin | tr -s " " | cut -d " " -f2)
for i in $ASN; do
  whois -h ${WHOISSERVER} -- "-i origin ${i}" | grep ^${FILTER} | tr -s " " | cut -d " " -f2-
done

Continue reading “Shell Script to get the network list by domain name”

Get IP address Space By AS(Autonomous System) Number

Sometimes you need to get all possible address blocks of a network but most of the time there is no easy way to figure it out, looking at you Facebook and Google, but fear not sysadmin we have one handy trick up in our sleeve, by using whois with the AS number of the company we can build this kind of list.
 
We’ll use Facebook(AS32934) as an example, but it should work for any Autonomous System.


whois -h whois.radb.net -- "-i origin AS32934" | grep ^route | tr -s " " | cut -d " " -f2-

Continue reading “Get IP address Space By AS(Autonomous System) Number”

Centos 7 with IPV6 at Server4You

As of 2019-10-01, the hosting company server4you.com doesn’t support IPv6, but if you want to test IPv6 or support your IPv6 capable clients there are still a few tricks you can try.
A good way is to use a broker to create a 6in4 tunnel with your IPv4 to the IPv6 enabled internet.

***** Disclaimer *****
 
This guide DOES NOT WORK if you are using their offerings of the vServer family because it’s powered by OpenVZ, but it will work perfectly with the VDS family powered by KVM or with their dedicated servers.
This is NOT a “true” IPv6 solution as you will use a tunnel broker to make a 6in4 tunnel, but it gets the job done for most workloads.
 
***** End Of Disclaimer *****
 
Continue reading “Centos 7 with IPV6 at Server4You”

Zombasite error while loading shared libraries: libpng12.so.0

If you are trying to run Zombasite GoG Version and the game is not starting properly what you can do to try and debug the issue is to run in in a terminal and see the output.


~/GOG\ Games/Zombasite/start.sh

 
If you get de following output:


Running Zombasite
./Zombasite: error while loading shared libraries: libpng12.so.0:
 cannot open shared object file: No such file or directory


 
This output means you are missing at least libpng12.
Continue reading “Zombasite error while loading shared libraries: libpng12.so.0”

RIP Sound Card Audio in Linux

Sometimes you need a quick and dirty way of ripping the audio of your sound card, in Linux you can easily do it with the following script:


#!/bin/bash
set -x
WAV="$1"
if [ -z "$WAV" ]; then
    echo "Usage: $0 OUTPUT.WAV" >&2
    exit 1
fi
rm -f "$WAV"

# Get sink monitor:
MONITOR=$(pactl list | egrep -A2 '^(\*\*\* )?Source #' | \
    grep 'Name: .*\.monitor$' | awk '{print $NF}' | tail -n1)
echo "set-source-mute ${MONITOR} false" | pacmd >/dev/null

# Record it raw, and convert to a wav
echo "Recording to $WAV ..."
echo "Close this window to stop"
parec -d "$MONITOR" | sox -t raw -b 16 -e signed -c 2 -r 44100 - "$WAV"

 
Store it somewhere in your PATH, and when you need to record the audio just use it as:


./soundRipper.sh output.wav

 
If you don’t want to store wave files you can convert it as shown HERE

Sources:

https://outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/
https://www.pantz.org/software/alsa/recording_sound_from_your_web_browser_using_linux.html