Tutorial

Using the EAC Log Checksum Tool in Linux

Unfortunately, it doesn’t take a great deal of determination to spoof a poor log into recording a 100%, and with that in mind, a new feature in EAC 1.0 called “log checksums” is a welcomed one. What it does is append a checksum string to the end of the logs it produces, which can be run back against the program’s checker to verify whether or not it has been tampered with.

Because running Windows-based command-line applications under Linux can be tedious, this quick guide will show you how to set up a terminal alias to help ease the pain.

Step One

Required Software: Wine (Latest version is best)

You will need to make sure you have access to an EAC 1.0 install folder. This could be a folder from an actual install under Windows on a dual-boot machine, or the result of installing EAC under Wine. When installing EAC this way, uncheck the CDRDAO option as the install might not finish otherwise.

Step Two

Open up a terminal and type in ‘nano -w ~/.bashrc’. If nano is not installed, vim (or vi) can be used.

jackjeckel@icp:~$ nano -w ~/.bashrc

Once inside the file, scroll to a free line near the bottom and type in:

alias chk=’wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Exact\ Audio\ Copy/CheckLog.exe’


“chk” can be replaced with another term, like “chkeac”, “logchk”, and so on. It’s the command that will be used at the command prompt. It’s important to make sure that the folder structure points to the exact location as CheckLog.exe.I recommend running the Wine command at a command-line before entering it as an alias, just to assure it works.

When done, quit the file with Ctrl + X, push ‘y’ to save the file, and enter to close nano. Then close and reopen the terminal.

Step Three

Because I chose “chk” as the command to trigger the log checker, using it at the command line should work no problem. From here, logs that have a checksum can be checked as if the tool was built straight into Linux itself!

(Note, the invalid “Violent Delight – Transmission” log was for demonstration purposes.)


Setting up Transmission on a Gentoo VPS

This tutorial is geared towards both novice and advanced Linux users who are either thinking about purchasing a VPS or already own one, and want to setup an easy-to-use BitTorrent client that features a great-looking Web interface. Many people who setup a seedbox default to using rTorrent or Deluge, but Transmission is one that’s often overlooked, despite being feature-rich and reliable.

The biggest reason that some choose to use either rTorrent or Deluge is that a Web-based interface has the potential for being more of a security-risk. This, to me, isn’t a major concern, and I’ve never experienced an issue with mine, but for those who do care a lot about security, I’m going to list some tips to ensure your installation is as secure as possible.

Why do I choose Gentoo, and can this guide apply to other distributions? I choose Gentoo because for VPS use, it’s the easiest to use and manage. There’s a caveat that it has to compile everything it installs, but aside from that, getting Transmission, or even other clients like rTorrent, setup, is an easy process. As for this guide being applicable to other distributions… the answer is “maybe”. Most of the steps will work in all distributions, but the setup process will differ in minor ways.

Step One

Log into your VPS account and then reformat your VPS to use Gentoo. The version doesn’t matter, and neither does it matter whether you install a 32-bit or 64-bit version. If you are planning to A) use your VPS also as a webserver, or B) have more than 3GB of RAM installed, then opt for the 64-bit version if it’s available.

Step Two

If in Windows, connect to your VPS through Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/).

If on Linux or Mac, you can use whatever terminal application is available to you.

In Putty, the first screen you will see is Session. From here, type in your VPS’ IP address.

I recommend enabling TCP keepalives as well, to ensure that your SSH connection doesn’t timeout during use. For Linux or Mac, a keepalive option might already be enabled, but to verify, look at the documentation for your particular terminal and find out how to change the value.

Step Three

When finished with the configuration, use the Open button to start a connection to your VPS.

Once the connection has been established, you will need to A) log in as root, B) add a personal user account, C) change that account’s password and OPTIONAL D) update the OS.

The last step is optional as it will take a while to update the OS on most VPS machines. If you don’t mind waiting, or have a faster VPS than most, I’d recommend going through the update process for the sake of added security. Most Linux distributions available for VPS aren’t the most up-to-date, so it’s never a bad idea to make sure you’re current.

Alternatively, you can execute the command ‘emerge –sync ; emerge -uDav world‘ instead, which will display the list of packages to be upgraded. From there, you can cancel the update and look through the list, and manually update any packages that look important (openssh would be considered an important one).

If you chose to upgrade the packages on the system, you will want to run ‘etc-update’ after the process is done. This enables you to update configuration files on the fly, and for the most part, you can apply all changes since this is a new install. The OS will automerge non-significant changes, and for the rest, you can type in ‘-3′ and then ‘y’ + ‘enter’ until all the updates are applied.

Step Four

After a primary user has been created and you (may have) updated your OS, you can install Transmission. Like most Linux distributions that have software repositories, Gentoo doesn’t always have the latest version of any piece of software marked as “stable”. Therefore, if you install Transmission as is, you’re likely to get an older version, and that’s not what I’d recommend as later versions feature additional feature and security fixes.

Before installing Transmission, I recommend searching for the package at Package.Gentoo.org and seeing if there is a newer version available. You can also run ‘emerge -s transmission’ to see which version it would install as stable.

http://packages.gentoo.org/package/net-p2p/transmission

On this page, green = stable, orange = unstable and red = bleeding-edge or unavailable. It’s never recommended to install a red version, but if there are orange versions available, then that’s what you’d want to install.

Installing the Stable Version of Transmission
emerge -av transmission

Installing the Unstable Version of Transmission (Recommended)
32-bit OS:
ACCEPT_KEYWORDS=”~x86″ emerge -av transmission
or specific version:
ACCEPT_KEYWORDS=”~x86″ emerge -av =transmission-2.12

64-bit OS:
ACCEPT_KEYWORDS=”~amd64″ emerge -av transmission
or specific version:
ACCEPT_KEYWORDS=”~x86″ emerge -av =transmission-2.12

To see whether you are running the 32-bit or 64-bit version of Gentoo, run ‘uname -a’ at the command-prompt. Unless it specifies something akin to x86-64, it’s the 32-bit version.

Once one of the commands above are executed, the OS will first show you which version is going to be installed, and from there, you can type in ‘y’ or ‘yes’ and then enter to install it and its dependencies.

Step Five

With Transmission installed, close your SSH connection and reconnect using the primary user.

Once connected as a non-root user, type in ‘transmission-daemon’. After hitting enter, nothing will happen, but the program will be running in the background (verify by typing in ‘ps ax | grep transmission’). IMPORTANT: Close down transmission-daemon first before editing the configuration file, as your changes will be overwritten otherwise.

In my case, the program is ID 24040, so to close it:

kill 24040

Since the program was started at least once, a configuration file has been created that you must edit. This is located at /home/username/.config/transmission-daemon/settings.json. You can edit using the program nano. Open it using ‘nano -w /home/username/.config/transmission-daemon/settings.json’.

There are a couple of things to edit here. Here’s a list of the important ones:

“download-dir”: “/home/jackjeckel/Downloads”,

This is the download folder, and can be changed. For the sake of added security, I’d recommend changing it, because if someone does manage to exploit Transmission, it’ll be harder for them to find something when the default folder is changed.

“incomplete-dir”: “/home/jackjeckel/Downloads”,
“incomplete-dir-enabled”: false,

If you want your default download folder to be only for completed downloads, you can change the values here to save incomplete torrents elsewhere.

“peer-limit-global”: 240,
“peer-limit-per-torrent”: 60,

If you are planning to use your seedbox to seed a lot of torrents, these values could be increased accordingly if you believe they will be too limiting.

IMPORTANT SETTING
“rpc-port”: 9091,

This is the port required to connect to the WebInterface. Change it to a similarly high number.

IMPORTANT SETTING
“rpc-authentication-required”: false,
“rpc-password”: “{4ce8feb86766c4793c9213dd281cd1acfc7ef5c0tjSgnTIj”,
“rpc-username”: “”,

You don’t want your Transmission client to be accessible to anyone, so it’s important to create a username and password here, while also enabling the prompt. For the password, just edit the entire string that’s found in between the quotes. Anything you type here will be encrypted to the same hash form next time Transmission is run.

IMPORTANT SETTING
“rpc-whitelist”: “127.0.0.1″,

If you plan to connect to your Transmission client from only one Internet connection, you can change this IP address value to yours (check http://www.ipchicken.com for your IP). But, if your ISP changes your IP address on you often, this isn’t ideal since you will need to log into your VPS via SSH and change the value often. Ideally, a static IP is the way to go, but if that’s not available to you, you can change this value to *.*.*.* which means you can access it from anywhere.

“upload-slots-per-torrent”: 14

To upload to a greater number of people at once on a per-torrent basis, increase this number.

Example Configuration

Changed values have been made bold.

{
“alt-speed-down”: 50,
“alt-speed-enabled”: false,
“alt-speed-time-begin”: 540,
“alt-speed-time-day”: 127,
“alt-speed-time-enabled”: false,
“alt-speed-time-end”: 1020,
“alt-speed-up”: 50,
“bind-address-ipv4″: “0.0.0.0″,
“bind-address-ipv6″: “::”,
“blocklist-enabled”: false,
“blocklist-url”: “http://www.example.com/blocklist“,
“cache-size-mb”: 2,
“dht-enabled”: true,
“download-dir”: “/home/jackjeckel/torrents”,
“encryption”: 1,
“idle-seeding-limit”: 30,
“idle-seeding-limit-enabled”: false,
“incomplete-dir”: “/home/jackjeckel/torrents/incomplete”,
“incomplete-dir-enabled”: true,
“lazy-bitfield-enabled”: true,
“lpd-enabled”: false,
“message-level”: 2,
“open-file-limit”: 32,
“peer-limit-global”: 500,
“peer-limit-per-torrent”: 60,
“peer-port”: 51413,
“peer-port-random-high”: 65535,
“peer-port-random-low”: 49152,
“peer-port-random-on-start”: false,
“peer-socket-tos”: 0,
“pex-enabled”: true,
“port-forwarding-enabled”: true,
“preallocation”: 1,
“ratio-limit”: 2,
“ratio-limit-enabled”: false,
“rename-partial-files”: true,
“rpc-authentication-required”: false,
“rpc-bind-address”: “0.0.0.0″,
“rpc-enabled”: true,
“rpc-password”: “!.super#secret$password”,
“rpc-port”: 6800,
“rpc-username”: “juggalo”,
“rpc-whitelist”: “*.*.*.*”,
“rpc-whitelist-enabled”: true,
“script-torrent-done-enabled”: false,
“script-torrent-done-filename”: “”,
“speed-limit-down”: 100,
“speed-limit-down-enabled”: false,
“speed-limit-up”: 100,
“speed-limit-up-enabled”: false,
“start-added-torrents”: true,
“trash-original-torrent-files”: false,
“umask”: 18,
“upload-slots-per-torrent”: 50
}

Once finished editing the configuration, you can hit Ctrl + X to exit, at which point nano will ask you if you want to save. Type in ‘y’ and then enter to save the changes.

Step Six

It’s time to take Transmission for a spin! With the configuration file all edited, start Transmission again with ‘transmission-daemon’. This will start the service and allow you to connect to it through a browser.

The UI at first might look quite bland, but that’s because there are no torrents!

See how much better it looks when there are a slew of torrents loaded into it? From here, you can begin to add torrents using the “Open” button. If you want to save the torrents to a different folder than default, you can click the small icon to the bottom-left corner and change the default folder there (making sure to change it back again after the torrent has been added).

Happy torrenting!


split.sh – batch split of ape, wav, flac images

I wrote a script that splits ape, wav or flac files based on a cuesheet, transcodes them to flac (at compression level 8), adds tags based on the metadata in the cuesheet and renames them based on the tags (in the form %tracknumber% %tracktitle%).

Usage
Usage of split follows the form split -ext “top-level directory” where ext is one of ape, wav or flac and corresponds to the extension of the image you wish to split. The top-level directory can be either a folder containing numerous folders [of folders of folders, etc.] of images you wish to split or a single folder, and must be the absolute path (no using . either; ~ is fine though). If it is the former, and contains mixed folders with ape and flac images, you should run split with the -flac option first or you’ll wind up with a lot of empty ‘converted’ folders and a lot of complaints on the command-line (although nothing bad will happen).

Requirements
To use split, you must have, at minimum, shntool, flac and cuetools installed. In addition, you must have the script cuetag installed as /usr/bin/cuetag.sh. Some distributions install it as /usr/bin/cuetag; if your distribution does this, you must run ln -s /usr/bin/cuetag /usr/bin/cuetag.sh as root or adjust the script appropriately (sed -i ‘s/cuetag.sh/cuetag/’ split.sh. If you want to split ape images, you must have mac installed.

split.sh requires one cue file and one image file per folder. The cue file must be in the same folder as the image file you wish to split, but can be called anything.

Notes
The accuracy of the title for each track in the cuesheet is critical to split.sh’s operation. For this reason, you should make sure the titles are accurate and correspond to your (or waffle.fm’s) standards before using split.sh. This will prevent duplication of effort later. You can take care of composer/performer in the cuesheet if you want, but it is much easier to batch fix this in any half decent tagging program.

Be sure your edits don’t violate the cuesheet spec (don’t use ‘&’ for instance)! Also, make sure any characters you use are allowed for filenames–I don’t currently check for that.

Download
You can grab it from github – https://github.com/Theta91/split

Todo (Someday, maybe, as this suits my current needs just fine)

  • Make relative paths work
  • Make sure the image file getting converted has a cue file in the same folder before attempting to convert it.

  • Sponsors

  • Twitter Feed

  • Comments

  • Copyright © 2009-2011 SK3TCHY. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress