Linux
Primarily Debian based like Ubuntu
Debian: Tidy up xml
daniel Mon, 01/31/2011 - 1:29pm
From: QualityBrain.com
cat ugly.xml | tidy -utf8 -xml -w 255 -i -c -q -asxml > pretty.xml
- Read more about Debian: Tidy up xml
- Log in to post comments
Printing to a Printer on a cups server from Mac os
daniel Mon, 01/17/2011 - 9:24pm
This walkthrough assumes you already have cups configured to listen on your network at port 631
Download and install the 3 programs listed here:
Useful link on linux foundation.org
Go to System Preferences > Print & Fax
Click on the little plus sign to add a new printer
Protocol: Protocol should be ipp
Address: Enter the ip address of the cups server followed by :631 For example, 192.168.1.1:631
Queue: Enter the queue name of the printer. You can get this by looking at the cups config on the server, One way would be the http interface on the server (In the above example at http://192.168.1.1:631)
Print Using: "Select Printer Software"
In the menu, find your printer - go for the ijs version.
Print a test page.
- Read more about Printing to a Printer on a cups server from Mac os
- Log in to post comments
Useful Linux Commands List
daniel Sat, 11/27/2010 - 12:33pm
- Read more about Useful Linux Commands List
- Log in to post comments
mysqldump: Got error: 144: Table 'mytablename' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES
daniel Sun, 11/21/2010 - 1:54pm
Had a surprise this morning as my backup process had created a 250GB backup file, and the machine seemed basically locked up. So, I power cycled it.
I had this email from my back up job:
mysqldump: Got error: 144: Table 'mytablename' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES
In phpMyAdmin I saw that the table was marked as locked (I think, don't 100% remember this step).
A quick google search turned up these: A doc on the dev.mysql.com site and a forum post at garayed.com
I ran the following commands as the database root user:
repair table 'mytablename';
unlock tables;
Everything seems to be working properly now.
Send / List / Empty deleted files to / in the trash from the command line on Ubuntu
daniel Fri, 10/29/2010 - 12:10pm
Excellent post on managing trash from the command line on karuppuswamy.com
View Grub screen and start single user mode Ubuntu10
daniel Thu, 10/28/2010 - 9:44am
For some configurations of Ubuntu, you no longer see the Grub login screen. Here's how to bring it back as needed:
As you are booting up (just after the bios is done) press and hold "shift". You should see the Grub screen now.
Select the "Recovery mode" Option to start single user mode
You can do things here like reset passwords, and fix broken configurations. Just be sure to restart after.
Stop a service from starting on boot - Linux/Ubuntu
daniel Thu, 10/28/2010 - 9:37am
My apache process requires an ssl cert with a password, which means that apache cannot successfully start at boot time (and just hangs), so I have set it to not start on boot. Here's how:
sudo update-rc.d -f apache2 disable
From: Unix Tutorial.org
Now, whenever I restart, I need to start Apache2 manually... Annoying yes, slightly more secure, yes...
Start apache with
sudo /etc/init.d/apache2 start
Open a File Manager window from the command line and vice versa in Linux (Gnome)
daniel Wed, 10/20/2010 - 1:21pm
So, you are in the terminal (command line), and thinking, "I would rather be seeing this in a nice gui manner".
If you are using Gnome, just type
# nautilus .
Or, a full path in place of the .
Very simple...
To go the other way around ("I would rather be seeing this at the command line")
Install the Nautilus plugin (in ubuntu):
sudo apt-get install nautilus-open-terminal
logout/login or restart
Right clicking in Nautilus should now show a menu item for: "Open in Terminal"
Again, very simple...
Enjoy!
JVisualvm not working after Ubuntu 10.10 upgrade
daniel Thu, 10/14/2010 - 8:58am
I was getting a message about running jvisualvm in a valid jdk instead of a jre (open-jdk) after I upgraded from Ubuntu 10.04 to Ubuntu 10.10. The upgrade had updated Java from 6.0.20 to 6.0.21.
A quick check of update-alternatives showed the the sun-jdk was still selected.
sudo update-alternatives --config java
When I looked in /usr/bin there was an actual binary there for jvisualvm... how odd... I expected a soft link to /etc/alternatives. i checked to see if a package was installed for jvisualvm:
dpkg -l | grep jvisualvm
nothing...
So my solution - remove the old binary:
sudo rm /usr/bin/jvisualvm
And add a soft link to jvisualvm
sudo ln -s /usr/lib/jvm/java-6-sun/bin/jvisualvm jvisualvm
- Read more about JVisualvm not working after Ubuntu 10.10 upgrade
- Log in to post comments
Status.net Installation Guide on Ubuntu Server 10.04
daniel Tue, 08/31/2010 - 3:39pm
Additional Stuff
Follow some of this guide for enabling sms/mail actions.
particularly:
sudo apt-get install php-pear php5-imap php5-dev make
I had to do this twice because the first bombed out...
sudo pecl install mailparse
sudo echo 'extension=mailparse.so' > /etc/php5/apache2/conf.d/mailparse.ini
sudo /etc/init.d/apache2 restart
need to setup a separate domain
Important guide if you're using postfix:
http://status.net/wiki/Postfix
FROM THE README
SMS
StatusNet supports a cheap-and-dirty system for sending update messages
to mobile phones and for receiving updates from the mobile. Instead of
sending through the SMS network itself, which is costly and requires
buy-in from the wireless carriers, it simply piggybacks on the email
gateways that many carriers provide to their customers. So, SMS
configuration is essentially email configuration.
Each user sends to a made-up email address, which they keep a secret.
Incoming email that is "From" the user's SMS email address, and "To"
the users' secret email address on the site's domain, will be
converted to a notice and stored in the DB.
For this to work, there *must* be a domain or sub-domain for which all
(or most) incoming email can pass through the incoming mail filter.
1. Run the SQL script carrier.sql in your StatusNet database. This will
usually work:
mysql -u "statusnetuser" --password="statusnetpassword" statusnet < db/carrier.sql
This will populate your database with a list of wireless carriers
that support email SMS gateways.
2. Make sure the maildaemon.php file is executable:
chmod +x scripts/maildaemon.php
Note that "daemon" is kind of a misnomer here; the script is more
of a filter than a daemon.
2. Edit /etc/aliases on your mail server and add the following line:
*: /path/to/statusnet/scripts/maildaemon.php
3. Run whatever code you need to to update your aliases database. For
many mail servers (Postfix, Exim, Sendmail), this should work:
newaliases
You may need to restart your mail server for the new database to
take effect.
4. Set the following in your config.php file:
$config['mail']['domain'] = 'yourdomain.example.net';
At this point, post-by-email and post-by-SMS-gateway should work. Note
that if your mail server is on a different computer from your email
server, you'll need to have a full installation of StatusNet, a working
config.php, and access to the StatusNet database from the mail server.
