View
Pinned

Script to update vim or neovim pathogen and bundles

Because I use the execelent pathogen plugin for vim or neovim, I wrote a small script to update it and the bundles I use:

```
#!/usr/bin/env zsh

which curl >/dev/null || {
echo "curl not found in path…"
exit 1
}
which git >/dev/null || {
echo "git not found in path…"
exit 1
}

for BASE_DIR in "${HOME}/.vim" "${HOME}/.config/nvim"; do
PATHOGEN_DIR="${BASE_DIR}/autoload"
BUNDLES_DIR="${BASE_DIR}/bundle"

if [[ -d "${PATHOGEN_DIR}" ]]; then

sbt override default resolvers

If you work with sbt (or activator) and want to restrict the resolvers to the ones that you choose then you might get frustrated that overriding the resolvers setting does not suffice.

To achieve resolution only via your configured resolver(s) you have to use the externalResolvers setting.

externalResolvers := List("My repository" at "https://repo.example.com")

Akka, scala and wartremover: Inferred type containing Any on Receive method

If you're using the fabulous wartremover to keep your code cleaner and are using akka too then you might have stumpled upon the following warning from wartremover:

Inferred type containing Any
    override def receive: Receive = {
                                    ^

To suppress the warning you can either turn off the "wart" completely but it is better to simply annotate the receive method of your actors like this:

@SuppressWarnings(Array("org.wartremover.warts.Any"))
over...

Windows 10 disable web search

If you search in Windows 10 then by default search results from the web (Bing) are included. To disable that just click on the settings icon after you opened the search dialog.

There you can disable Cortana and afterwards disable web results.

Remove multiple remote branches with git

If you want to delete a remote git branch then you can do so using the following command.

% git push origin :BRANCH-NAME

However if you cleanup a repository and have multiple remote branches you want to remove then you could do something like this:

% git branch -r | awk -F/ '/\/SOME-PREFIX/{print $2}' | xargs -I {} git push origin :{}

This will delete all remote branches starting with SOME-PREFIX.

Google chrome issues on FreeBSD (GLIBCXX and chrash on sync)

After upgrading my chrome port on FreeBSD 9.3 I got the following error message when I tried to start chrome:

% chrome
/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11 required by /usr/local/share/chromium/chrome not found

To fix this I had to install the patchelf util and execute to following command.

# patchelf --set-rpath /usr/local/lib/gcc47 /usr/local/share/chromium/chrome

Afterwards chrome started up but crashed when it tried to synchronize. To fix this the protobuf port had to be reinstalled with some custom CFLAGS.

Repeats

Import private key and certificate into java keystore

From time to time you have to update your SSL keys and certificates. In some cases you may have a mixed infrastructure e.g. "normal" http servers and tomcat or other java based servers. In the latter case you'll have to import your shiny new certificate and key into your java keystore.

There are several methods that you can use but I found the following the most simple:

  1. Export your key, certificate and ca-certificate into a PKCS12 bundle via

    % openssl pkcs12 -export -in my.crt -inkey my.key -chain -CAfile my-ca-file.crt -name "m...
    

slick slick-pg and

If you happen to use the fine postgres extension for slick named slick-pg then you might stumble into an issue where the compiler complains about missing implicits for column types that should be provided by slick-pg if you override the api method of the custom postgres driver.

```text
[error] …/src/main/scala/Tables.scala:13: could not find implicit value for parameter tt: slick.ast.TypedType[java.time.ZonedDateTime]
[error] def z = columnZonedDateTime

FreeBSD CUPS upgrade leading to "No such file or directory" error

If you upgrade cups on your FreeBSD installation or maybe you install some foomatic packages this may lead to the removal of the cups-filters package. In some cases this package is needed for your printer to work correctly.

If printing with cups gives an error like this: No such file or directory then you should re-install the cups-filters package. Afterwards the printer should work again.

Windows 10 remove web stuff from start menu

The start menu of Windows 10 displays some stuff from the internet by default. If you find this annoying like me then feel free to follow this guide to fix that.

  1. Open the registry editor (regedit.exe).
  2. Navigate to the following path in the registry: HKEY_CURRENT_USER -> Software -> Microsoft -> Windows -> CurrentVersion -> Explorer -> Advanced.
  3. There create a new DWORD (32bit) value that is named EnableXamlStartMenu.
  4. Now you can either restart the explorer task or reboot your machine.

If you open the start menu now you sh…

Aqbanking, GnuCash, HBCI Sparkasse Vorpommern

Nach einer neuerlichen Umstellung des Onlinebankings hatte ich nach über einem Jahrzehnt reibungslosen Ablaufs Probleme die HBCI-Verbindung neu einzurichten.

Es stellte sich heraus, daß man entgegen der Empfehlung der Bank sowohl den Benutzernamen als auch die Kundennummer angeben mußte. Letztere mußte dabei einem bestimmten Format genügen (siehe unten):

Parameter Wert
Benutzername Name des Kontoinhabers
Benutzerkennung Die Benutzerkennung von der Bank.
Kundennummer Die Benutzerkennung von der Ban…

Bulk promises with EmberJS

I needed not to chain promises but to resolve a whole bunch of them together. The documentation was sparse so it took me a while to stumble upon the solution (Ember.RSVP.all). In case you need something like that here it is.

promises = someFancyStuff.map (resource) -> createPromise(resource)
Ember.RSVP.all(promises).then((results) -> doSomethingWithIt(results))

You can create an array of promises that you pass into Ember.RSVP.all which passes an array of the results into the .then chain. Actually quite simple. :-)

Confluence reverse proxy and firefox

If you're running confluence behind a reverse proxy then you might stumble upon an issue that prevents firefox from working correctly. Strange bugs will hapen like clicking on "add a new page" resulting in endless loading loops.

Checking the logfile of confluence you'll see something like this:

```
WARN [http-nio-8090-exec-6] [common.security.jersey.XsrfResourceFilter]
passesAdditionalBrowserChecks Additional XSRF checks failed for request:
http://localhost:9080/rest/analytics/1.0/publ…

Change commit author in git history

If you ever need to change the author of a commit (or several) within a git repository, you can use the following script:

```
#!/usr/bin/env bash

usage() {
echo "Please set the following enviroment variables:"
echo " OLD_EMAIL : your-old-email@example.com"
echo " NEW_EMAIL : your-correct-email@example.com"
echo " NEW_NAME : Your Correct Name"
echo "Then run the script again from a git repository directory."
echo "Example: OLD_EMAIL=alice@example.com NEW_EMAIL=bob@example.com NEW_NAME="Bob Doe" $0"
}

if [ ! -d .git ]; the…

A nice prompt for lftp

The prompt of lftp can be configured in the config file via the set prompt directive. A while ago I found a prompt on the internet but forgot where, here it is:

set prompt "\[\e[0;32m\]┌┼───┤\[\e[1;33m\] [lftp] \[\e[0;36m\]\u\[\e[0;33m\]\@\[\e[0;36m\]\h \[\e[0;32m\]├───┤\[\e[0;33m\]\w\[\e[0;32m\]├───\n└┼─\[\e[1;33m\]$\[\e[0;32m\]─┤► :\[\e[0m\] "

Chef knife SSL Validation error on FreeBSD

If you're using Chef on FreeBSD you might stumble upon the following error message when using the knife command.

ERROR: SSL Validation failure connecting to host: api.opscode.com - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
ERROR: Could not establish a secure connection to the server.
Use `knife ssl check` to troubleshoot your SSL configuration.

There are some tickets in the bugtracker and some resources describing workarounds w…

Small script for updating all git repositories within a directory.

A simple shell script that jumps into a given directory (or a default one) and updates all git repos in there. Additionally it checks if an upstream remote exists. If that is the case it fetches the upstream changes.

#!/usr/bin/env zsh

if [[ -z "$1" ]] then
  DIR=~/Code
else
  DIR="$1"
fi

CURRENT_DIR=`pwd`

for repo in "${DIR}/"*; do
  if [[ -d "${repo}/.git" ]] then
    cd "${repo}"
    echo -e "\033[1mFound git repository in $repo.\033[0m"
    git fetch
    if [[ ! -z `git ...

Nokogiri gem on FreeBSD, libiconv missing error

If you try to install the nokogiri gem on freebsd you may get the following error message:

libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.

In that case it should suffice to use the following command to install the gem:

% gem install nokogiri -v 'DESIRED_VERSION' -- --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include

If you get further error messages complaining about libxslt or libxml you may need a couple more options:

% gem...
View
61 cards