Installing AMD Catalyst in Fedora 20

Recently I did a fresh install of the Fedora 20 KDE spin. One of the things that I did not realize when installing Fedora 20 was that the AMD Catalyst package is no longer supported. What am I supposed to do? It seems the last available support in any rpm repos was for F19. Browsing the forums I could see a lot of people doing some editing and hacking attempting to get the older packages to work. Seeing all this, the old engineering adage came to mind, “if you’re trying too hard it’s because you are doing it wrong”.

Now don’t get me wrong, I would love to have the open source Radeon driver running on my box, but it simply doesn’t compare to the proprietary driver right now. My machine runs cooler with the proprietary driver and I have better video and graphics performance. So how do I get my ATI card working on my Fedora 20 install you ask? Here are the details:

Installing AMD Catalyst on Fedora 20:

For starters, you will need to have some prerequisite packages installed to get the driver working:

# yum install gcc binutils make kernel-devel kernel-headers

Secondly, you will want to grab AMD Catalyst 13.11 beta from AMD, unzip it and make it executable:

wget –-referer=’http://support.amd.com/en-us/download/desktop?os=Linux+x86′ http://www2.ati.com/drivers/beta/amd-catalyst-13.11-betav9.95-linux-x86.x86_64.zip

# unzip amd-catalyst-13.11-betav9.95-linux-x86.x86_64.zip

# chmod a+x amd-catalyst-13.11-betaV9.95-linux-x86.x86_64.run

Within your root terminal, navigate to your package and run the .run file:

# ./amd-catalyst-13.11-betaV9.95-linux-x86.x86_64.run

You should be installing the driver with no hitch now. (If running Gnome, see possible caveats below). After you have rebooted, check it went okay with this command $ fglrxinfo, though I can visually discern the driver is working because my screen resolution is correct and much, much better looking.

Here is some sample output from my box:

[demux@localhost ~]$ fglrxinfo
 display: :0  screen: 0
 OpenGL vendor string: Advanced Micro Devices, Inc.
 OpenGL renderer string: ATI Radeon HD 5670
 OpenGL version string: 4.3.12615 Compatibility Profile Context 13.25.18

Possible Caveats:

There are always caveats right? I only know of this working on XFCE and KDE, though it should work with others. However, there are reports that Gnome installs may run into some problems. This is apparently because Gnome has made provisions in their code to embrace the Wayland display server. The code within that is reported to conflict with the ATI code.

Also, you may have to re-install Catalyst after a kernel update. Though so far, I have not needed to. But it is possible. Dkms might allow the kernel to automatically incorporate the drive in new kernels, but I have not tested this or needed it thus far. If worse comes to worse, you will need to re-run the .run file. This method of install should work for future versions of Fedora as well and is really a general method of install for the proprietary driver.

Advertisements

Linux Password Cracker

python

python

It has been about a month since I have posted, that does not mean I have stopped coding. Lately I’ve been back on my “security” kick. Although for me it’s more of an obsession rather than just a kick. When it comes to security, a programming language like Python can make many common task a breeze to accomplish. Here I have a basic Linux password cracker that can crack the current SHA-512 shadowed hashes from a user supplied dictionary and detect whether a hash is the lesser used MD5 or SHA-256 format. Enjoy.

import crypt

def testPass(cryptPass):
hashType = cryptPass.split("$")[1]
if hashType == '1':
print "[+] Hash Type is MD5"
elif hashType == '5':
print "[+] Hash Type is SHA-256"
elif hashType == '6':
print "[+] Hash Type is SHA-512"
else:
"[+] Hash Type is Unknown"

salt = cryptPass.split("$")[2]
dictFile = open('dictionary.txt', 'r')
for word in dictFile.readlines():
word = word.strip('\n')
pepper = "$" + hashType + "$" + salt
cryptWord = crypt.crypt(word, pepper)
if cryptWord == cryptPass:
print '[+] Found Password: ' + word + '\n'
return
print '[-] Password Not Found.\n'
return

def main():
passFile = open('passwords.txt')
for line in passFile.readlines():
if ':' in line:
user = line.split(':')[0]
cryptPass = line.split(':')[1].strip(' ')
print '[*] Cracking Password For: ' + user
testPass(cryptPass)

if __name__ == '__main__':
main()

Renaming Network Interfaces with Udev Rules

linuxRecently I have noticed something while troubleshooting some network traffic issues. My wireless interface decided to rename itself to an obscure string presumably after an update to either Network Manager or udev. Specifically wlan0 was being renamed to wlp0s22f2u1 when it had previously been wlan0 for as long as I can remember. Digging around, I realized that I no longer had the file: /etc/udev/rules.d/70-persistent-net.rules. This file contains rules that udev will use to name network interfaces, but it was missing. Fortunately it is easy to create or alter if you want to rename network interfaces to stable names.

Let's first grab the hardware address of the problem interface:
ifconfig -a

You will see some output like so:


wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1492
        inet 192.168.2.2  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::2c0:caff:fe40:b198  prefixlen 64  scopeid 0x20<link>
        ether 00:01:02:03:04:05  txqueuelen 1000  (Ethernet)
        RX packets 4407  bytes 2748119 (2.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6714  bytes 1423408 (1.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Amongst all the noise, we can see from our output of ifconfig that our hardware address is 00:01:02:03:04:05(ether or hwaddr line*). Now as root, create the file 70-persistent-net.rules with your favorite editor in /etc/udev/rules.d:

# vi /etc/udev/rules.d/70-persistent-net.rules

Now enter or copy/paste in this information. Remember, each rule needs to be on it's own line.

# wlan0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:01:02:03:04:05", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

Now you can either reboot or attempt a udev restart. A reboot will ensure rules are reloaded, but you can try some of these commands on various distros:

# udevadm control --reload-rules
or
# udevadm trigger

Closing thoughts. The system does work perfectly fine without renaming interfaces to stable names. And quite possibly a future udev upgrade may wipe this rule out. But for anyone like me who likes clean interface names or anyone needing to rename interfaces for reasons out of context here, this is one way to do this on many Linux distros.

C Program To Determine Byte Order (Endianness)

C programRecently I needed to needed to check the endianness of a machine. I assumed the machine was Little Indian but wanted to make sure, thus this C code snippet. It’s important to understand that endian.h is not cross-platform, and exist only on Linux machines. There are standard byte order functions you can use if you are on Windows to figure this stuff out. Perhaps I will show an example of that later.

ByteOrder.c


#include <stdio.h>
#include <endian.h>

int main (void)
{
#if BYTE_ORDER == LITTLE_ENDIAN
printf("system is little Endian \n");
#elif BYTE_ORDER == BIG_ENDIAN
printf("system is big Endian \n");
#else
printf("whats going on? \n");
#endif

return 0;
}