How can I force format read only usb drive in OSX
Check disk device with Disk Utility, then sudo diskutil unmountdisk force diskXXX sudo dd if=/dev/zero of=/dev/diskXXX bs=1024 count=1024
Check disk device with Disk Utility, then sudo diskutil unmountdisk force diskXXX sudo dd if=/dev/zero of=/dev/diskXXX bs=1024 count=1024
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist sudo launchctl start com.apple.tftpd files will be served from /private/tftpboot sudo launchctl stop com.apple.tftpd
GFlops, G-hours, and CPU hours 1 Flops, GFlops, and TFlops 2 G-hours 3 CPU Hours and CPU Years 4 Credits Flops, GFlops, and TFlops FLOPS is a standard measure of computing power — “Floating Point Operations Per Second”. A GigaFlop (or Gflop) is a billion FLOPS. A TeraFlps (or TFlop) is a trillion FLOPS. So […]
dpkg –get-selections \* | awk ‘{print $1}’ | xargs -l1 aptitude reinstall
/usr/bin/ruby -e “$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)” brew doctor
defaults write com.apple.Finder AppleShowAllFiles YES Relaunch Finder reset to normal: defaults write com.apple.Finder AppleShowAllFiles NO
PHP Tip – error_reporting(-1) at the top of your script during dev to turn on all warnings, notices, etc in all versions of PHP
in Terminal: +qtdefaults write LegacyCodecsEnabled yes+
Some wget installs have this nasty issue, for a quick fix, just use curl -C – -O http://yourfile
$ mkfile 10g /path/to/my/tengigfile
sudo update-alternatives –config java
lsb_release -a
$ vi /Library/LaunchDaemons/local.fetchmail.plist <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=”1.0″> <dict> <key>KeepAlive</key> <false/> <key>Label</key> <string>local.fetchmail</string> <key>Program</key> <string>/usr/bin/fetchmail</string> <key>ProgramArguments</key> <array> <string>/usr/bin/fetchmail</string> <string>–fetchmailrc=/Users/<snip>/.fetchmailrc</string> <string>–pidfile=/Users/<snip>/.fetchmail.pid</string> <string>–daemon=1800</string> <string>–nodetach</string> </array> <key>QueueDirectories</key> <array/> <key>RunAtLoad</key> <true/> <key>UserName</key> <string><snip></string> <key>WatchPaths</key> <array/> <key>WorkingDirectory</key> <string>/Users/<snip>/.fetchmail</string> </dict> </plist> $ mkdir /Users/<snip>/.fetchmail $ sudo launchctl load -w /Library/LaunchDaemons/local.fetchmail.plist $ tail -f /var/log/system.log
first, enable IMAP in gmail. $ vi .fetchmailrc if you have a mta running: poll imap.gmail.com protocol IMAP user ‘<snip>‘ there with password ‘<snip>’ is ‘<snip>‘ here options ssl keep sslcertck sslcertpath “/Users/<snip>/.ssl/certs” folder ‘[Gmail]/All Mail’ if not, deliver via procmail to /var/mail…: poll imap.gmail.com protocol IMAP user ‘<snip>‘ there with password ‘<snip>’ is ‘<snip>‘ […]
first, enable POP for all mail in gmail. $ vi .fetchmailrc if you have a mta running: poll pop.gmail.com with proto POP3 and options no dns user ‘<snip>’ there with password ‘<snip>’ is ‘<snip>’ here options ssl keep sslcertck sslcertpath “/Users/<snip>/.ssl/certs” if not, deliver via procmail to /var/mail…: poll pop.gmail.com with proto POP3 and options […]
$ pushd /System/Library/LaunchDaemons $ sudo plutil -convert xml1 /System/Library/LaunchDaemons/com.apple.syslogd.plist $ sudo vim /System/Library/LaunchDaemons/com.apple.syslogd.plist => add to “Sockets”: NetworkListener SockServiceName syslog SockType dgram $ sudo plutil -convert binary1 /System/Library/LaunchDaemons/com.apple.syslogd.plist $ sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist $ sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
If you’re using Safari, there’s an easy way to download flash videos. Open the page with the movie and press Command-Option-A, which shows the Activity window. If you’re also loading other sites, you’ll see a list of them: scroll until you find the YouTube page and click on the arrow to show details about what […]
sudo /Developer-3.2.6/Library/uninstall-devtools –mode=all
The safe way: sudo aptitude -F ‘%p’ search linux-{image,headers,restricted}-2.6~i | grep -v `uname -r | sed -r ‘s/-[a-z0-9A-Z]+$//’ or, if you’re feeling lucky: sudo aptitude -F ‘%p’ search linux-{image,headers,restricted}-2.6~i | grep -v `uname -r | sed -r ‘s/-[a-z0-9A-Z]+$//’` | xargs sudo aptitude purge -y
Since the howl package is no longer available, but the excellent avahi is, here’s how to install and configure it: (with an older OpenBSD system, you might want to check out: http://doink.org/index.php?option=com_content&task=view&id=52&Itemid=1) 1. run a pkg_info on avahi: Information for ftp://ftp.openbsd.org/pub/OpenBSD/4.8/packages/i386/avahi-0.6.27.tgz Comment: framework for Multicast DNS Service Discovery Description: Avahi is a free, standards-compliant implementation […]
run: $ grep flags /proc/cpuinfo if you see a lm flag, this means Long mode cpu = 64 bit CPU
$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport Supported arguments: -c[] –channel=[] Set arbitrary channel on the card -z –disassociate Disassociate from any network -I –getinfo Print current wireless status, e.g. signal info, BSSID, port type etc. -s[] –scan=[] Perform a wireless broadcast scan. Will perform a directed scan if the optional is provided -x –xml Print info as XML -P […]
A note on MacOSX Memory: Briefly, free memory is available to be used right now; wired memory is basically system memory for the kernel and other stuff; active memory is memory being used right now; and inactive memory stores info from recently quit applications. The idea with inactive memory is that if you quit and […]
e.g. /Applications/Compressor.app/Contents/MacOS/Compressor -clustername “This Computer” -batchname “Test Batch” -jobpath “/Volumes/.mov” -settingpath “/Users/administrator/Library/Application Support/Compressor/Formats/QuickTime/Uncompressed 10-bit .setting” -destinationpath “/Volumes.mov” just change settingpath & destinationpath…
1. Local: ssh-keygen scp ~/.ssh/*.pub username@remote: ssh username@remote 2. Remote mkdir .ssh cat ~/*.pub >> ~/.ssh/authorized_keys rm *.pub chmod 644 ~/.ssh/authorized_keys -or- Script it like this: ssh-keygen scp ~/.ssh/*.pub user@remote:`uname -n`.pub ssh user@remote “cat ~/*.pub >> ~/.ssh/authorized_keys” ssh user@remote “rm ~/*.pub”
get three network cards, two for the bridge, mine are re0, em0 & em1 (re0 = admin connection to serve sshd) echo ‘dhcp’ > /etc/hostname.re0 echo ‘up’ > /etc/hostname.em0 echo ‘up’ > /etc/hostname.em1 echo ‘add em0’ > /etc/hostname.bridge0 echo ‘add em1’ >> /etc/hostname.bridge0 echo ‘blocknonip em0’ >> /etc/hostname.bridge0 echo ‘blocknonip em1’ >> /etc/hostname.bridge0 echo ‘up’ […]
How to Change Your Hostname In OpenBSD A quick note on how to change your hostname and IP configuration in OpenBSD. /etc/hosts Vastly more important in BSD than it is in Linux. This is where you specify the IP address of your hostname. Change the hostname here to match your hosts new name. It should […]
du -ksl * | sort -nr
if this doesn’t work for you: ffmpeg2theora in.mov -o out.ogv or ffmpeg2theora in.mov -v 8 -o out.ogv (To solve the video artefacts) Try the following: from tracey jaquith at archive.org use ffmpeg to turn any video to “rawvideo”. pipe its output to *another* ffmpeg to turn the video to “yuv4mpegpipe”. pipe its output to the […]
from http://www.lightsphere.com/dev/articles/design_for_iphone.html The iPhone can display most websites without modification, however the user often won’t be able to read the text or see anything useful without pinch-zooming on your page. Here’s how to set up an iPhone-friendly version of your website that doesn’t require zooming. 1. Set the viewport width inside the <head> section of […]
The Nikon D90 is a fantastic DSLR, but as we speak, it has a huge bug. Here’s the fix for that: from http://www.mattias.nu/plugins/ D90 Rescaler (New Nov 2008) If you’re a D90 user I’m sure you’ve seen the stairstepping of diagonal lines, as well as the flickering aliasing of horizontal lines. No more, thanks to […]
SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = ‘tablename‘;
Install lvm2: $ sudo apt-get install lvm2 Load the necessary module(s): $ sudo modprobe dm-mod Scan your system for LVM volumes: $ sudo vgscan Activate the volume: $ sudo vgchange -ay VolGroup00 Find the logical volume that has your external root file system: $ sudo lvs Create a mount point for that volume: $ sudo […]
use the normal substitute commands such as: :%s/oldword/newword/ but use the keyboard shortcut CtrlVCtrlM to create a new-line character
hdiutil burn image.iso
example: cat oldfile | awk ‘{gsub(“;old text string”, “new text string”); print}’ > newfile mv -f newfile oldfile