Disk Utility, for whatever reason, is prohibited from writing Joliet (ISO 9660) onto MS-DOS FAT 32 Flash Drives, though it should definitely work.
The best way to accomplish your goal is the following:
Open Terminal
Type 'diskutil list'. You'll see your primary hard drive (probably listed under /dev/disk0) and your Flash Drive, which will be listed as /dev/disk#, with # being any number that isn't zero. REMEMBER THE DISK LOCATION
In the next line, type 'diskutil unmountDisk /dev/disk#'. You'll see this message on success:
Unmount of all volumes on disk# was successful
Now type, 'dd if=(DRAG ISO/DMG HERE) of=/dev/disk# bs=1m'
Tuesday, 29 November 2011
Thursday, 27 October 2011
Install iLife from MacBook Air USB Key
Stick the USB stick into another Mac and try the command below in Terminal:
open /Volumes/Mac\ OS\ X\ Install/Packages/iLife/iLife.pkg
open /Volumes/Mac\ OS\ X\ Install/Packages/iLife/iLife.pkg
Friday, 21 October 2011
Get the text from a PDF
I needed this at short notice, and it works flawlessly.
I like the use of PDF’s, they work well and (usually) appear the same on ever computer. One of the advantages of PDF’s is the text embedded within the file, and the abilty to manipulate. Although many PDF readers have functions to copy and paste text, whats quicker than creating an Automator script to extract PDF text into a text file.
This process only take a couple of steps so read carefully.
1) Open Automator, found in Applications > Utilities
2) In Automator drag out “Get Selected Finder Items”, then “Extract PDF Text”. I recommend changing the output option to Rich Text.
3) Save the file. Either as an application or a file.
4) Test. Drag a PDF file onto the Automator file and let it do its work, after a short time you will have a text file with the extracted text.
Wednesday, 15 June 2011
How To scp, ssh and rsync without prompting for password
Whenever you need to use scp to copy files, it asks for passwords. Same with rsync as it (by default) uses ssh as well. Usually scp and rsync commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an expectscript to provide the password. Of course, I didn't. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it...
Lets say you want to copy between two hosts host_src and host_dest. host_src is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy!
- On host_src, run this command as the user that runs scp/ssh/rsync$ ssh-keygen -t rsaThis will prompt for a passphrase. Just press the enter key. It'll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default~/.ssh/id_rsa.pub:Your public key has been saved in <your_home_dir>/.ssh/id_rsa.pub
- Transfer the id_rsa.pub file to host_dest by either ftp, scp, rsync or any other method.
- On host_dest, login as the remote user which you plan to use when you run scp, ssh orrsync on host_src.
- Copy the contents of id_rsa.pub to ~/.ssh/authorized_keys
$ cat id_rsa.pub >>~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys
- Note that ssh by default does not allow root to log in. This has to be explicitly enabled on host_dest. This can be done by editing /etc/ssh/sshd_config and changing the option of PermitRootLogin from no to yes. Don't forget to restart sshd so that it reads the modified config file. Do this only if you want to use the root login.
If this file does not exists, then the above command will create it. Make sure you remove permission for others to read this file. If its a public key, why prevent others from reading this file? Probably, the owner of the key has distributed it to a few trusted users and has not placed any additional security measures to check if its really a trusted user.
Well, thats it. Now you can run scp, ssh and rsync on host_src connecting to host_dest and it won't prompt for the password. Note that this will still prompt for the password if you are running the commands on host_dest connecting tohost_src. You can reverse the steps above (generate the public key on host_dest and copy it to host_src) and you have a two way setup ready!
Wednesday, 1 June 2011
Adding Users to phpbb forums
So, we have a site that uses the PHPBB forum as a backbone, but we need to add users to it without them going through the normal procedure in the front end:
Here's how
Here's how
define('IN_PHPBB', true);
global $db;
global $config;
global $user;
global $auth;
global $cache;
global $template;
global $phpbb_root_path;
global $phpEx;
$phpbb_root_path = 'forums/'; // forum directory path here
$phpEx = substr(strrchr(__FILE__, '.'), 1);
//include($phpbb_root_path . 'common.' . $phpEx);
include('forums/common.php');
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
require($phpbb_root_path .'includes/functions_user.php');
$username = $_POST['user'];
$password = $_POST['password']; // Dont encrypt the password!
$email = $_POST['email'];
// Check for unique username otherwise it will throw an error or might be blank page
$user_row = array(
'username' => $username,
'user_password' => md5($password), 'user_email' => $email,
'group_id' => 2, #Registered users group
'user_timezone' => '1.00',
'user_dst' => 0,
'user_lang' => 'en',
'user_type' => '0',
'user_actkey' => '',
'user_dateformat' => 'd M Y H:i',
'user_style' => 1,
'user_regdate' => time(),
);
$phpbb_user_id = user_add($user_row);
Friday, 27 May 2011
A Painful Safari - Crashes, stalls?
Ever had one of those days, where everything just seems to be going wrong? Over the last 6 hours, I’ve been trying to debug why Safari, Mail.app, iTunes and Adium crash without ANY explanation, after any of said applications tried to load a webpage.
It started randomly (haven’t made major changes in the last few days), so I assumed it was something corrupted. The only hint was that after Safari, Mail, iTunes or Adium crashed, PubSubAgent would use 100% CPU time. So, I fire up Instruments and look at the trace for PubSubAgent. It seems to be calling CFHTTPCookieStorageFlushCookieStores many times, which is odd, because a quick Google doesn’t return anything useful about this system call, obviously related to CFHTTP.
Fast forward 4 hours later when I’ve cleared caches, nuked my Safari config, tried removing PubSubAgent (which just made it worse). The fix? Removing ~/Library/Cookies/Cookies.plist.
Oddly enough, it has a companion – ~/Library/Cookies/Cookies.plist – corrupt.
Oddly enough, it has a companion – ~/Library/Cookies/Cookies.plist – corrupt.
So, just a recap; somewhere the system knew my Cookies file was corrupted. But instead of spitting this out to the Console, throwing a Dialog, or ANY form of useful information, I had to trudge through my Library looking for something which could be causing the problem, and manually removing it. It was by chance that I noticed the Cookies folder, which is strangely not in the Safari folder where one would normally expect it.
And just to make matters worse; Safari’s “Reset Safari” did nothing to solve the problem. That’s right, checking the “Remove all cookies” checkbox did NOT remove the cookies!
Tuesday, 24 May 2011
Creating Linux (Centos) Live CD image on a USB Flash Driv
Then follow these steps:
- Type : diskutil list in the Terminal and hit Enter
- Plug in your USB flash disk and repeat step 1
- Compare the result and you’ll have the device node assigned to your flash media. Usually something like "/dev/disk2" (sans quote)
- Type : diskutil unmountDisk /dev/diskN in the Terminal and hit Enter. You’ll have to replace the /dev/diskN with the device node that you got from step 3. From the picture above you can see that the device node assigned for my USB flash drive is "/dev/disk1" (sans quote)
- Type : sudo dd if=/path/to/downloaded.img of=/dev/diskN bs=1m in the Terminal and hit Enter. But there are several things that you have to change here before you hit Enter:
- first the /path/to/downloaded.img is the location of the downloaded UNR installer file. As we’ve already taken care of this before, all you’ve got to do is to change the string into/unr.img
- second, the /dev/diskN is the device node which is the same as step 4
- and the last, if you see the error line: dd: Invalid number ’1m’ then you need to change thebs=1m into bs=1M (notice the capital ‘M’) - Write your password, hit enter, and wait until the process is finished. Please be warned that all the data in the USB drive will be lost.
- Type : diskutil eject /dev/diskN in the Terminal and hit Enter.
- Unplug your USB drive.
Friday, 18 February 2011
Change open_basedir in Plesk
This tutorial will show you how to change the open_basedir option on a Linux server with Plesk control panel.
Almost all the custom changes that can be made in Plesk but not through the GUI, must be set in vhost.conf file for each domain.
The location of this file is under $DOMAIN$/conf/
$DOMAIN$ should be replaced with a real path to domain home. For example it could be/var/www/vhosts/domain.com/ (on Fedora with Plesk) or/usr/local/psa/home/vhosts/domain.com (on FreeBSD with Plesk). As you can see this location may vary depending on Plesk version and OS. To find where the vhosts home is look into /etc/psa/psa.conf for HTTPD_VHOSTS_D variable set.
Inside $DOMAIN$/conf/vhost.conf you can change the options with the appropriate apache format. Here is an example about how to set open_basedir with 'none' option:
In case you want to do the same for SSL, just create a file 'vhost_ssl.conf'
Then put the settings inside to be for the secured document root folder :
<Directory $DOMAIN$/httpdocs>
php_admin_value open_basedir "$DOMAIN$/httpdocs:/tmp:/ADD_PATH"
</Directory>
There is one thing you have to do for appropriate using of $DOMAIN$/conf/vhost.conf . You must include this file into $DOMAIN$/conf/httpd.include like in the example bellow.
Just run the command below to make this happen:
Almost all the custom changes that can be made in Plesk but not through the GUI, must be set in vhost.conf file for each domain.
The location of this file is under $DOMAIN$/conf/
$DOMAIN$ should be replaced with a real path to domain home. For example it could be/var/www/vhosts/domain.com/ (on Fedora with Plesk) or/usr/local/psa/home/vhosts/domain.com (on FreeBSD with Plesk). As you can see this location may vary depending on Plesk version and OS. To find where the vhosts home is look into /etc/psa/psa.conf for HTTPD_VHOSTS_D variable set.
Inside $DOMAIN$/conf/vhost.conf you can change the options with the appropriate apache format. Here is an example about how to set open_basedir with 'none' option:
<Directory /var/www/vhosts/somedomain.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir none
</Directory>
In case you want to do the same for SSL, just create a file 'vhost_ssl.conf'
Then put the settings inside to be for the secured document root folder :
<Directory $DOMAIN$/httpdocs>
php_admin_value open_basedir "$DOMAIN$/httpdocs:/tmp:/ADD_PATH"
</Directory>
There is one thing you have to do for appropriate using of $DOMAIN$/conf/vhost.conf . You must include this file into $DOMAIN$/conf/httpd.include like in the example bellow.
Just run the command below to make this happen:
/usr/local/psa/admin/sbin/websrvmng -v -a
Saturday, 29 January 2011
Wow, who would have thought - Multi Region Samsung
I've found this hack somewhere on the internet, it works for my R2 player.
1) Turn on the player with no disc in the tray
2) Press the Open/Close button to open the tray
3) Press the info button, the firmware version shows up (mine was 080220.13.B.1080PXKEG)
4) After the version info disappears, close the tray again by pressing the Open/Close button
5) At this point, it will show "no disc" at the top. Press the Info button again, and this will disappear.
6) Now type the code that applies for your region (R2 is 57538). A '2' will briefly show up at the top left corner
7) Now press 9, and 9 will show up in the top left corner
8) Power off the player, and turn it on again. You'll have a multi region player
I've found the following codes at the 1080P7 hack:
R1 - 29334
R2 - 57538
R3 - 56732
R4 - 76884
R5 - 53814
R6 - 24462
Not sure if all are correct, but it worked for R2.
1) Turn on the player with no disc in the tray
2) Press the Open/Close button to open the tray
3) Press the info button, the firmware version shows up (mine was 080220.13.B.1080PXKEG)
4) After the version info disappears, close the tray again by pressing the Open/Close button
5) At this point, it will show "no disc" at the top. Press the Info button again, and this will disappear.
6) Now type the code that applies for your region (R2 is 57538). A '2' will briefly show up at the top left corner
7) Now press 9, and 9 will show up in the top left corner
8) Power off the player, and turn it on again. You'll have a multi region player
I've found the following codes at the 1080P7 hack:
R1 - 29334
R2 - 57538
R3 - 56732
R4 - 76884
R5 - 53814
R6 - 24462
Not sure if all are correct, but it worked for R2.
Subscribe to:
Posts (Atom)