Tiny Deathstars of Foulness

Did you know that you can ask Apple Configurator to give you a lot more logs than it does by default? Holy crap. Makes life so much simpler when you’re having problems, to actually get real logs. And then there’s that… To get more logs, close Apple Configurator and then write All into the LogLevel key in defaults write LogLevel ALL Re-open Apple Configurator and you’re golden. Then, have some problems and be so happy to get some logs, viewable in Console. Screen Shot 2013-09-03 at 12.40.21 AM

September 4th, 2013

Posted In: iPhone, Mac OS X, Mac OS X Server

Tags: , , ,

The most important command for managing pretty much anything in Linux is vi. So if you only learn one command, learn that one. But if you want to learn another, the second most important command for managing Xen is then xm (well, once you’ve apt-gotten or yummied up the installation that is). The xm command has a number of easy verbs, each used for managing the Xen environment.
  • xm info – Shows information about the Xen host
  • xm list – Shows information about doms (states include r for running, b for blocked, c for crashed, p for paused and the worse, d for dying).
  • xm network-list – Shows virtual interfaces for doms
  • xm log – Shows information from the Xen logs
  • xm reboot – Reboots a VM
  • xm vcpu-list – Shows dom virtual processors
  • xm top – Shows hosts and domains similar to how top works in *nix
  • xm uptime – Shows uptime
  • xm dmesg – Shows the send message buffer
  • xm create – Create a node called
  • xm console – Switch to that new node
  • xm destroy – Deletes that newly created node
  • xm shell – Invoke an interactive shell environment of your xend
  • xm shutdown – Turn off a VM
  • xm pause – Rather than shut the VM down, just pause it (starts back up much faster), but if the host is rebooted then state is lost (otherwise use suspend)
  • xm suspend – Suspends a VM, which writes the data to disk, so changes wouldn’t be lost on restart.
  • xm rename – Rename installed VMs
  • xm resume – If a VM is paused, fire it up
  • xm save  – Similar to suspend except with user definable state file
  • xm restore – Similar to resume except restoreable with exports that used the save verb
  • xm dump-core – Dumps core per domain
  • xm sysrq – Sends system requests per domain
  • xm block-list – Lists block devices per domain
  • xm mem-max – Configure the maximum memory for a domain
  • xm mem-set – Configure the current memory allowance for a domain
  • xm vcpu-set – Configure active processors for a domain
  • xm migrate – Move a domain to another server (e.g. using the -l operator to do so live)
Virt-manager and virt-install can be used to manage and create virtual machines for use with Xen. Virsh can also be of assistance:
  • virsh nodeinfo – Shows information about each node
  • virsh vcpuinfo – Shows information about virtual processors
  • virsh dominfo – Shows information about domains
  • virsh dumpxml  – Dumps the same information just in parseable XML

April 20th, 2013

Posted In: Ubuntu, Unix, VMware

Tags: , , , , , ,

You can ls /dev/console to see the currently logged in user of a machine. To do so: /bin/ls -l /dev/console You can also just grab the username, as follows /bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'

February 13th, 2013

Posted In: Mac OS X, Mac OS X Server

Tags: , , , , ,

In BRU 2, you have 3 tools to use. These include:
  • BRU Server Agent Config (UB) – A tool used to install the agent, which needs to be located on each machine that will be backed up (including the server if it has any data to back up)
  • BRU Server Config (UB) – Used to configure the server daemon, backup server configurations and set passwords to communicate with the server. Also used to set licensing information and perform scans for new tape drives and libraries.
  • BRU Server Console (UB) – Used to configure backup jobs, schedules, etc.
To get started, open the BRU Server Config application from the components that come with your software (or that you downloaded from the BRU website). First you will be asked to provide an administrative password to BRU. Provide the password and then click on Save. Next, the server components will be copied to /usr/local/bru-server. The system will also perform a hardware scan of your server, looking for tape drives and libraries (you can always rerun this process later if need be). Once the processes are complete the BRU Server Configuration Tool will open and you can configure the server. To do so, first click Start to start the daemon. If you need to restart it at a later date you can simply click on the Stop or Restart buttons here. Then, if like most, you would like for the server to start at boot, check the box for Server daemon starts at boot. Here, you can also use the Backup and Restore buttons to backup and restore server configurations or the Modify button to enter a new password for the server. You can also perform most of these options from the command line using the server command located in /usr/local/bru-server. For example, to stop the server, you would use the –kill option:
/usr/local/bru-server/server –kill
To then start the server, run it with no arguments:
Or to set the password, you would use (go figure) the –password option:
/usr/local/bru-server/server –password
You can also perform some options not exposed in the Configuration Tool GUI, such as running it on a custom port using the –port option followed by the port number:
/usr/local/bru-server/server –port=8090
Finally, you can check the version and license information using the –version and –license options respectively. Once you are satisfied with your configuration of the server component, you will then close the tool and move on to installing the Agent(s). Each machine that will get backed up will need an agent installed. Configure the options for the BRU Agent using the BRU Server Agent Config application. Simply open the application from your installer. On first open, the agent will copy /usr/local/bru-server to your machine (if you installed the server it will just copy the agent portions of BRU), which will contain the agent. You will also then see a b icon in the menu bar. Click on the b icon in the menu bar and then click on Agent Configuration to bring up a screen similar to the following. Here, click on the Start button to configure the agent. You will typically want the agent to start automatically when you install a system, so click on the check box for Agent daemon starts automatically. You will then need to provide a server that the agent can communicate with. To do so, click on the plus sign (+) on the screen and then provide the server that the agent can communicate with and the credentials to do so. Once complete, you will then be able to see the client system in the Server Console. You can also configure it from the command line, fairly easily. To do so, run the agent, located in /usr/local/bru-server, along with the –config option:
/usr/local/bru-server/agent –config
The BRU Server Agent Configuration will then enter into the interactive mode and you will see any BRU Server Console’s that the agent is configured to communicate with. Here, type N and then you will be prompted for the hostname of your BRU Server. Here, provide the  name or an IP address for the server and then hit the enter key. When prompted, provide a password to enter into the Console. The server will then be assigned a unique number. Entering that at the interactive prompt will then remove the server again. Once the agent has been started, it can be stopped by running the agent command with the –kill option:
/usr/local/bru-server –kill
Note: For Windows, the configuration command line tool is located in C:Program FilesBRU Server Agent Configuration. Now that you have configured the agent and the server, it’s time to actually setup jobs and schedules. To get started, open the BRU Server Console application. The console components will then be copied into /usr/local/bru-server. Click on OK and then the authenticate to the server. Once you have logged in, you will see the console. If the installation of the agents went properly, you should see any that you have installed as well. Disk-to-Disk backups in BRU are mostly considered a staging area, where data is stored while waiting to be shuttled to tape. To set the staging area, click on the BRU Server Console menu and then click on Preferences… In the Stage Path field, provide a path that the stage files will be stored in. You can also set the maximum age of the staging data and the number of jobs to be stored in the history. When you’re satisfied with your settings, click on the Save button. Back at the Console screen, you will click on the plus sign (+) to add a new backup job, which will bring up the screen you see here. The backup job will include the following options:
  • Job name: A name for the job.
  • Destination: Where the backup will be written to. You can use Stage Disk or choose a tape drive/library.
  • Backup Type: Your first job will need to be a full, subsequent jobs can be incremental or differential, which will require you to set a full job that you have created as the “Base Job”. An incremental will backup files that have been altered since the last incremental or full backup. A differential will backup all files altered since the last full, even if they were already backed up. Differentials will lead to faster restore times as you near the end of a backup cycle; however, they will usually take up considerably more space.
  • Base Job: The full backup job to base a differential or incremental backup job on.
  • Compression: Whether or not the software will attempt to compress data. Enabling compression causes slower backups, but takes up less space.
  • Email: An address to send backup reports to for the given job.
  • Verify Backup: Performs a scan of backed up files to ensure they match the source. This will take longer than if you do not enable it but provides peace of mind/assurance/etc.
  • Eject Tape after job completes: Only used if you are using tape, usually not used if you are using tape libraries.
  • Enable archive encryption: Encrypts archives 😉
Once you have configured a job as you see fit, click on OK and you will be taken back to the BRU Server Console screen. For each job you will still need to configure a schedule for the job as well as what source directories/files to be backed up. To set the schedule, click on the job name to be scheduled and then click on the Schedule… button. At the Job Scheduler screen, set the frequency and starting times that your job should run at and then click on the Save button. You will then need to configure the source directories for your backups. Back at the Console screen, click on the name of the job and then click on each directory to be backed up. Clicking on a directory will cycle through color codes. The colors indicate whether or not the directory will be backed up:
  • yellow indicates that part of a directory will be backed up
  • green indicates the entire directory will be backed up
  • red indicates that a directory will explicitly be skipped
When you are satisfied with your backup job, click Save. You will then configure an incremental or differential job for each base job and finally a job that is specifically for upstaging data to tape, or completing the disk-to-disk-to-tape sequence. When you are finished configuring each of your jobs you can run them manually to test by clicking on the Run Now while the job is selected from the console. When running, you can monitor each job using the Tools icon in the side bar and then the Job Monitor option in the Tools drop-down menu. To stop a job that is running, you can click on the Kill command here. You can also run jobs from the command line, using the backup option for the bru-server.cmd command located in /usr/local/bru-server. The command can be run using the -j option (name of job), followed by the name of the job to be run, followed by the -t option (type of job), followed by the type of job being run (ie – Full, Incremental or Differental), followed by -Z (enable compression) and -v (enable verification), followed by the paths (starting with server names) to be backed up in brackets. For example, to run our test job:
backup -j “test” -t “Full” -Z -v [“/krypted//Volumes/Installers”]
This allows you to somewhat seamlessly integrate the backup of files that are archived with Final Cut Server, by calling up the backup command as a post-flight action for any automations kicked off by Final Cut Server. You can also backup data using the bru-server.cmd command in /usr/local/bru-server. You can then restore files that are backed up using the bru-server.cmd command’s restore option. In order to use the restore option, you’ll need to know which archive the file is stored in. In order to find that you will also need to script the search option (search for the appropriate file and then craft your restore to pull data back to the restore path for fcsvr_client using the correct archive that the file is stored on). To search through the archives for the appropriate file:
search “my”
You can also provide archives as part of the search, but we likely wouldn’t be searching here if we knew which ones to use. Note: The BRU commands are based on python. When the python environment on a machine has been customized the results for BRU can be unexpected.

June 9th, 2010

Posted In: Mac OS X, Mac OS X Server, Mac Security

Tags: , , , , , , , , , ,

May 13th, 2007

Posted In: Unix

Tags: , ,