How to get all repositories of a specific GitHub user

To get more than 100 repositories from GitHub it’s necessary to follow the links inside the link header. If you do not want a specific library you can use Requests.

import requests

def get_repositories(url):
    result = []
    r = requests.get(url=url)
    if 'next' in r.links :
        result += get_repositories(r.links['next']['url'])

    for repository in r.json():
        result.append(repository.get('name'))

    return result

url = "https://api.github.com/users/stackforge/repos"
print get_repositories(url)

Missing initramfs images on Fedora Rawhide

Wth Dracut it is possible to generate initramfs images on Fedora. The configuration of Dracut is available in /etc/dracut.conf. To overwrite an existing initramfs image add the parameter --force

dracut /boot/initramfs-3.15.0-1.fc21.x86_64.img 3.15.0-1.fc21.x86_64

The Grub2 configuration should be regenerated afterward using grub2-mkconfig -o /boot/grub2/grub.cfg.

To simplify your life use the following script.

#!/bin/sh

# author: Christian Berendt <mail@cberendt.net>

set -x

for kernel in $(find /boot/vmlinuz*); do
    version=$(basename $kernel)
    version=${version#*-}
    if [ ! -e /boot/initramfs-$version.img ]; then
        sudo /usr/bin/dracut /boot/initramfs-$version.img $version
    fi
done

for image in $(find /boot/initramfs*); do
    version=${image%.img}
    version=${version#*initramfs-}
    if [ ! -e /boot/vmlinuz-$version ]; then
        sudo rm $image
    fi
done

sudo /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg

Also posted on Stack Overflow.

Google Chrome and Fedora 21

At the moment it is not possible to use Google Chrome with Fedora 21 out of the box.

It is not possible to install the provided RPM package because of a missing dependency libgcrypt.so.11.

% sudo rpm -Uvh google-chrome-stable_current_x86_64.rpm
error: Failed dependencies:
	libgcrypt.so.11()(64bit) is needed by google-chrome-stable-35.0.1916.114-1.x86_64

When installing the RPM package using the paremter --nodeps it is also not possible to run google-chrome.

% sudo rpm -Uvh --nodeps google-chrome-stable_current_x86_64.rpm

% google-chrome
/usr/bin/google-chrome: /lib64/libgcrypt.so.11: version `GCRYPT_1.2' not found (required by /usr/bin/google-chrome)

To be able to use Google Chrome with Fedora 21 you have to install the package compat-libgcrypt provided at http://copr.fedoraproject.org/coprs/red/libgcrypt.so.11.

% sudo wget -O /etc/yum.repos.d/red-libgcrypt.so.11-fedora-rawhide-i386.repo http://copr.fedoraproject.org/coprs/red/libgcrypt.so.11/repo/fedora-rawhide-i386/red-libgcrypt.so.11-fedora-rawhide-i386.repo

% sudo yum install compat-libgcrypt