Saturday, December 21, 2013

Feed the Beast Ubuntu install script

This is a simple install script I made for Feed the Beast. It will set up the launcher in the actual applications folder, which makes it easier to add to steam and your desktop. Also included the icon for it.



if [ "$(id -u)" != "0" ]; then
   echo "Must be root." 1>&2
   exit 1

echo "Setting up install..."
mkdir "$USRDIR"
cd "$USRDIR"

echo "Downloading files..."
wget -O FTB_Launcher.jar ""
wget -O ftbicon.png ""

echo "Adding application..."
cat <<_END > /usr/games/feedthebeast

java -jar $USRDIR/FTB_Launcher.jar
chmod +x /usr/bin/feedthebeast

cd /usr/share/applications

cat <<_END > feedthebeast.desktop
[Desktop Entry]
Name=Feed the Beast
GenericName=Feed the Beast
Comment=Feed the Beast

echo "Adding man page..."
cd /tmp
cat <<_END > /tmp/feedthebeast.6
.\" Manpage for Feed The Beast.
.TH man 6 "$(date +'%d %b %Y')" "1.0" "feedthebeast man page"
feedthebeast \- Launch client
Launches Feed the Beast client launcher
gzip -c /tmp/feedthebeast.6 > /usr/share/man/man6/feedthebeast.6.gz

echo "Updating database..."
cd /usr/share/man/man6
mandb -q

echo "Installation complete."
echo "May require relog to show up."
read -p "Press enter to end. "

Thursday, December 19, 2013

Purge old man pages for apropos

This is something I wanted to do for a while on Ubuntu, and I'm not sure if it will work on other distributions. The main problem is that I would remove a program and the man page for it would remain. This gets annoying when I'm searching for stuff and end up double checking on what was removed or decide to try a command I removed. The solution is simple, but takes a few minutes to run. As root, run these commands.

cd /usr/share/man
rm -R /var/cache/man

As simple as that and all the old stuff gets removed. This just simply removed the cached manual pages then reconstructs it.

Tag Cloud

.NET (1) A+ (1) addon (6) Android (3) anonymous functions (5) application (9) arduino (1) artificial intelligence (2) bash (3) c (7) camera (1) certifications (1) cobol (1) comptia (2) computing (2) css (2) customize (15) encryption (2) error (15) exploit (13) ftp (2) gadget (2) games (2) Gtk (1) GUI (5) hardware (6) haskell (15) help (5) HTML (4) irc (1) java (5) javascript (20) Linux (18) Mac (4) malware (1) math (8) network (5) objects (2) OCaml (1) perl (4) php (8) plugin (6) programming (42) python (24) radio (1) regex (3) security (21) sound (1) speakers (1) ssh (1) telnet (1) tools (11) troubleshooting (1) Ubuntu (3) Unix (4) virtualization (1) web design (14) Windows (6) wx (2)