Commit 94a57b07 authored by René Jochum's avatar René Jochum

New blog posts.

parent dd9e3662
baseurl: "http://hugo.pc-dummy.net"
copyright: "This work is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0)."
languageCode: en-us
MetaDataFormat: yaml
......
---
date: 2015-07-14T21:00:00+01:00
title: Diff-configs.sh a nice tool to get your configuration changes
author: pcdummy
tags:
- Ubuntu
- Debian
- Apt
---
Since some time i use [diff-configs.sh](https://gist.github.com/matthewd/1254787) to
show all my manual config changes, its very nice to transfer them.
#### Installation
pushd .
mkdir ~/bin
wget https://gist.githubusercontent.com/matthewd/1254787/raw/diff-configs.sh -O diff-configs
chmod +x diff-configs
popd
#### Usage
sudo $(which diff-configs)
---
date: 2015-07-14T19:42:00+01:00
title: Firefox Addons i use.
author: pcdummy
tags:
- Firefox Addons
---
These are the Firefox Addons i use for privacy, development and some fine utilities.<!--more-->
#### Privacy
- [uBlock](https://github.com/gorhill/uBlock)
Open Source AddBlock Plus.
- [Ghostery](https://addons.mozilla.org/de/firefox/addon/ghostery/)
Blocks tracker cookies and websites.
- [HTTPS-Everywhere](https://www.eff.org/de/https-everywhere)
Uses HTTPS wherever possible.
- [KeeFox](https://addons.mozilla.org/de/firefox/addon/keefox/)
Integrates KeePass into Firefox.
- [FlagFox](https://addons.mozilla.org/de/firefox/addon/flagfox/)
Shows you where the server your connection to is.
#### Development
- [IPvFox](https://addons.mozilla.org/de/firefox/addon/ipvfox/)
Show's whetever i'm connecting over IPv4 or IPv6.
- [Firebug](https://addons.mozilla.org/de/firefox/addon/firebug/)
Nice to debug Javascript and Networking.
- [Web Developer](https://addons.mozilla.org/de/firefox/addon/web-developer/)
Every developer should have this installed, a lot of handy tools.
#### Utilities:
- DownThemAll!
It has a great feature to limit the Download Bandwith.
- User Agent Overrider
Need this for Silverlight testing.
- [Greasemonkey](https://addons.mozilla.org/de/firefox/addon/greasemonkey/)
Modify sites on the client side with Javascript (add/remove features and so on)
#### Addons
- OpenH264 (Comes with FF)
......@@ -5,6 +5,9 @@ author: pcdummy
tags:
- howto
- hugo
- atom
- markdown
- sublime
---
Today i moved my wordpress blog to hugo, it will allow me to **post faster** use **less resources** and i can **share** my content **on [github](https://github.com/pcdummy/pc-dummy.net)**.
......@@ -25,12 +28,11 @@ now i'm able to just copy it to my blog and publish it.
- On-liner to test trough all themes, **run in your sites root**:
<pre><code class="bash">
for i in $(find themes/ -maxdepth 2 -iname 'theme.toml'); do \
echo -e "\nCurrent Theme: $(expr match "$i" 'themes\/\(.*\)\/theme.toml')\n"; \
hugo server --buildDrafts --watch \
--theme=$(expr match "$i" 'themes\/\(.*\)\/theme.toml'); \
done</code></pre>
for i in $(find themes/ -maxdepth 2 -iname 'theme.toml'); do \
echo -e "\nCurrent Theme: $(expr match "$i" 'themes\/\(.*\)\/theme.toml')\n"; \
hugo server --buildDrafts --watch \
--theme=$(expr match "$i" 'themes\/\(.*\)\/theme.toml'); \
done
#### This blog uses:
......
---
date: 2015-06-14T00:19:30+01:00
title: Pulseaudio as network audio sender/receiver
author: pcdummy
tags:
- Howto
- Linux
- Pulseaudio
- Network Audio
---
I use Pulseaudio to send my audio to a different computer where i have a sound system plugged in,
and i switch between computers with sound stations.
This howto will help you to create you'r own OSS Network audio sender and receiver.<!--more-->
#### This is what i do on each receivers (servers)
You might want to change **10.0.0.0/8** to your own IPv4 subnet you want allow to send audio.
mkdir $HOME/.pulse
cp /etc/pulse/default.pa $HOME/.pulse
echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.0.0.0/8" >> $HOME/.pulse/default.pa
pulseaudio --kill
sleep 2
pulseaudio -D
#### On the sender (client)
On the client i create multible configurations, change **<name>** to your name you want. (like home/company/friend).
mkdir $HOME/.pulse
cp /etc/pulse/client.conf $HOME/.pulse/client-nonet.conf
cp /etc/pulse/client.conf $HOME/.pulse/client-<name>.conf
echo "default-server = 10.167.160.103:4713" >> $HOME/.pulse/client.conf
#### Receiver switch script (on the client)
I use this script to change between receivers, sometimes i need to call it twice to work.
mkdir $HOME/bin
source $HOME/.bashrc
cat << 'EOF' > $HOME/bin/pulseswitch
#!/bin/sh
if test -z "$1"; then
echo "USAGE: pulseswitch [nonet|<your-config>]"
exit 1
fi
echo "Switching to \"$1\"."
/bin/ln -fs $HOME/.pulse/client-$1.conf $HOME/.pulse/client.conf
/usr/bin/pulseaudio --kill
/usr/bin/pulseaudio -D
if [ "x$1" = "xnonet" ]; then
echo "Unloading the net module."
/usr/bin/pactl unload-module module-native-protocol-tcp
else
echo "Loading the net module."
/usr/bin/pactl load-module module-native-protocol-tcp
fi
/usr/bin/pulseaudio --kill
/usr/bin/pulseaudio -D
EOF'
---
date: 2015-06-14T00:15:30+01:00
title: Mass convert WMA to mp3
author: pcdummy
tags:
- Howto
- Linux
- WMA
- MP3
---
This is what i did to convert all my wma soundfiles to mp3's.<!--more-->
#### 1.) Install libav-tools
sudo apt-get install libav-tools
#### 2.) Convert WMA to mp3
cd <your musik path>;
find . -iname '*.wma' -exec /bin/bash -c "avconv -i '{}' -acodec libmp3lame -ab 320k '{}.mp3'" \;
#### 3.) Remove WMA's
cd <your musik path>;
find . -iname '*.wma' -exec rm -f {} \;
#### 4.) Use Puddltag to change tags and rename files
sudo apt-get install puddletag;
puddletag <your musik path>
#### 4. Remove empty Directories
find <your musik path> -type d -empty -exec rm -rf {} \;
#!/bin/bash
# This script will make a best-effort attempt at showing modifications
# to package-provided config files on a Debian system.
#
# It's subject to some pretty significant limitations: most notably,
# there's no way to identify all such config files. We approximate the
# answer by looking first at dpkg-managed conffiles, and then hoping
# that most of the time, if maintainer scripts are managing files
# themselves, they're using ucf. So, DO NOT TRUST THIS SCRIPT to find
# everything... but it should help to find most customisation.
# Set this non-empty to see a diff against empty for apparently-deleted
# files; leave it empty for a single 'file deleted' note.
diff_empty=
# Space-separated list of directory *trees* to be searched for package
# files. This is the only means of locating packages that can't be
# installed by apt. Note that we do a recursive search in here *before*
# we ask apt to download the package; don't point it at a stupidly-large
# tree.
local_packages="/var/cache/puppet"
package_version() {
pkg="$1"
dpkg-query -W -f='${Version}\n' "$pkg"
}
# I've made no attempt to create a sensible overall ordering; we keep
# files grouped by package within a particular section, then hope that
# most packages won't mix config file types.
#############
# conffiles
package_file() {
pkg="$1"
exec 3< <(dpkg-query -W -f='${Version} ${Architecture} ${Status}\n' "$pkg")
read -u3 version arch status
if [ "$status" != "install ok installed" -o -z "$version" ]; then
# Package isn't actually installed; ignore it.
exit 0
fi
basename="${pkg}_${version//:/%3a}_${arch}.deb"
filename="/var/cache/apt/archives/$basename"
if [ -f "$filename" ]; then
echo "$filename"
exit
fi
found="$(find $local_packages -name "$basename" -print -quit)"
if [ -n "$found" ]; then
echo "$found"
exit
fi
if [ "$UID" -gt 0 ]; then
echo "Package ${pkg} (${version}, ${arch}) is not available; need to install, but not root" >&2
exit 1
fi
apt-get -qq --download-only --reinstall install "${pkg}=${version}"
if [ -f "$filename" ]; then
echo "$filename"
else
echo "Failed to download ${pkg} (${version}, ${arch})" >&2
exit 1
fi
}
original_content() {
pkg="$1"
file="$2"
deb="$(package_file "$pkg")"
if [ "$?" -ne 0 -o -z "$deb" ]; then
exit 1
fi
dpkg-deb --fsys-tarfile "$deb" | tar -x -O ".$file"
}
dpkg-query -W -f='${Conffiles}\n' '*' |
awk 'OFS=" "{print $2,$1}' |
md5sum -c 2>/dev/null |
awk -F': ' '$2 !~ /OK/{print $1}' |
xargs dpkg -S |
sort -u |
awk -F ': ' 'OFS=" "{print $1,$2}' |
while read pkg file; do
if [ ! -f "$file" -a -z "$diff_empty" ]; then
echo "Deleted: $file (from $pkg)"
else
content="$(original_content "$pkg" "$file")"
if [ "$?" -eq 0 ]; then
echo "package $pkg"
diff -u --new-file --report-identical-files --label "$pkg $(package_version "$pkg")" <(echo "$content") "$file"
else
echo "Failed to load original for $file from $pkg"
fi
fi
echo
done
#######
# ucf
md5sum -c /var/lib/ucf/hashfile 2>/dev/null |
awk -F': ' '$2 !~ /OK/{print $1}' |
xargs ucfq -w |
sort -t ':' -k 2,1 | uniq |
awk -F: 'OFS=" " {print $1,$2}' |
while read file pkg; do
if [ ! -f "$file" -a -z "$diff_empty" ]; then
echo "Deleted: $file (from ${pkg:-??})"
else
cache="/var/lib/ucf/cache/${file//\//:}"
if [ -f "$cache" ]; then
if [ -n "$pkg" ]; then
echo "package $pkg"
label="$pkg $(package_version "$pkg")"
else
label="original"
fi
diff -u --new-file --report-identical-files --label "$label" "$cache" "$file"
else
echo "Failed to load original for $file from ${pkg:-??}"
fi
fi
echo
done
Subproject commit 57a0999e4fbd20ca78f818646fca0a069f6addf7
Subproject commit 0ea25c35ae8529796fee9432bae0572e8b93c2b1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment