rubysecurity.org

Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive

Tag Cloud


Currently Reading

MCA Microsoft Certified Associate Azure Administrator Study Guide: Exam AZ-104
MCA Microsoft Certified Associate Azure Administrator Study Guide: Exam AZ-104
308 / 435 Pages


Latest Book Reviews

Latest Posts


August 13, 2013

Exporting data in MySQL to an XML file

by Alpha01

So I just started reading a new MySQL administration book and starting to learn cool things that I didn’t even know. One cool feature MySQL supports that I wasn’t aware of is the ability to export and import data to and from XML files.

For example the following will export the table City from world database to an XML file.

root@mysql:~# mysql --xml -e 'SELECT * from world.City' > city.xml

To import data from the XML itself can be accomplished using the LOAD XML statement.

(root@localhost) [world] LOAD XML INFILE 'city.xml' INTO TABLE City;
Query OK, 4079 rows affected, 14 warnings (0.81 sec)
Records: 4079  Deleted: 0  Skipped: 0  Warnings: 14

Resources

Tags: [ mysql ]
July 28, 2013

ZFS on Linux: Kernel updates

by Alpha01

Just as I would expect, updating both the kernel’s of the machine that is running VirtualBox and its virtual machines and the ZFS enabled Linux virtual machine has completed with absolutely no issues. Originally, I was more concern on updating the host VirtualBox machine’s kernel given that I’ve never really done this in the past using the additional VirtualBox Extension Pack add-on before, while on the other hand I wasn’t to concern regarding the ZFS kernel module, given that it was installed as part of a dkms kernel module rpm. Which regardless of what people think about dkms modules, as a sysadmin that have worked with Linux systems with them (proprietary), it’s certainly a relief knowing that little or no additional work is needed to rebuild the respective module after updating to a newer kernel.

Tags: [ ubuntu virtualbox zfs ]
June 1, 2013

lsof alternative in Solaris 11

by Alpha01

(Warning: output is pretty ugly)

pfiles /proc/*
Tags: [ solaris networking ]
April 13, 2013

User creations in Solaris 11

by Alpha01

To my surprise Solaris 11 does not create new user’s home directory by default.

Errors

root@solaris:~# su - testuser
su: No directory!
root@solaris:~# pwck
[....]
testuser:x:106:10::/export/home/testuser:/usr/bin/bash
        Login directory not found

Fix

root@solaris:~# useradd -m testuser
80 blocks

In the process, I learned something new about the su command. In Linux, when switching from root to a limited user, I used to do the following:

[root@rubyninja ~]# su tony -

What I did not know was that the above command will indeed load up the PATH of tony, but it will also append root’s PATH at end of it which is kind of scary. In theory the command that I wanted to use was su - username, luckily this feature is not supported in Solaris 11.

root@solaris:/# su testuser -
bash: /root/.bashrc: Permission denied
Tags: [ solaris ]