Nov 22

javascript.show.hide.div.content

<script>
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
 browserType= "gecko"
}

function hide2() {
  if (browserType == "gecko" )
     document.poppedLayer =
         eval('document.getElementById("realtooltip2")');
  else if (browserType == "ie")
     document.poppedLayer =
        eval('document.getElementById("realtooltip2")');
  else
     document.poppedLayer =
        eval('document.layers["realtooltip2"]');
  document.poppedLayer.style.display = "none";
}

function show2() {
  if (browserType == "gecko" )
     document.poppedLayer =
         eval('document.getElementById("realtooltip2")');
  else if (browserType == "ie")
     document.poppedLayer =
        eval('document.getElementById("realtooltip2")');
  else
     document.poppedLayer =
         eval('document.layers["realtooltip2"]');
  document.poppedLayer.style.display = "inline";
}

</script>

<form>
<input type=button onClick="hide2()" value="hide">
<input type=button onClick="show2()" value="show">
</form>
<div id="realtooltip2" style="display: inline">
<big>Real's HowTo</big>
<layer></layer></div>

Nov 18

command line - apple - ISO

» IT, Mac «

hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso

Nov 17

.DS_Store file

» IT, Mac «

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Nov 15

MacOsX show hidden files

» IT, Mac «

# defaults write com.apple.Finder AppleShowAllFiles TRUE

# KillAll Finder

Nov 2

ftp commands

» IT, Mac, Windows «

ls: directory listing equivalent to dir.
ls -l: long directory listing, more detail.
pwd: display the name of current directory.
cd: change directory.
lcd: change the local current directory.
get: to download the file from the FTP server.
put: to transfer file and place it on the FTP server.
mget: to download multiple files from the FTP server.
mput: to transfer multiple files to the FTP server.
prompt: to turn on/off interactive mode.
binary: to turn on binary mode.
ascii: to turn on ascii mode.
delete: to turn a file on FTP server.
status: to display how the current FTP session is configured.
mkdir: to make directory on FTP server.
quit/close/bye/disconnect: to disconnect from the FTP server.

Oct 14

MacOS billentyűparancsok

» IT, Mac «
  • Control-F2 : Navigate to the menubar (then use arrow keys)
  • Control-F3 : Navigate to the dock (then use arrow keys)
  • Command-Tab : Switch applications
  • Command-` : Switch windows within the current application
  • Command-H : Hide current app or Finder
  • Command-Option-H : Hide everything but the app in use
  • Command-N : Launch a new Finder window (Finder only)
  • Command-O : Open a Finder folder (Finder only)
  • Command-D : Duplicate selected File or Folder (Finder only)
  • Command-Delete : Move the selected item to Trash (Finder only)
  • Shift-Command-Delete : Empty Trash (Finder only)
  • Begin typing the name of a Folder or File and it will become selected within the Finder
  • Use arrow keys to navigate around the items within a Finder window

Oct 14

How to spoof your MAC address in Mac OS X

» IT, Mac «

A MAC address is a unique identifier assigned to your network card, and some networks implement MAC address filtering as a method of security. Spoofing a MAC address can be desired for multiple reasons, and it is very easy to spoof your MAC address in both Mac OS X 10.4 and 10.5. For the purpose of this article, we are going to assume you want to spoof your Mac’s wireless MAC address. So without further ado, here’s a 3 step process on how to do it:

Retrieving your current MAC address
First, you’re going to want your current wireless MAC address so you can set it back without rebooting. Launch the Terminal and type the following command:
ifconfig en1 | grep ether
You’ll know see something like:
ether 00:12:cb:c6:24:e2
And the values after ‘ether’ makeup your current MAC address. Write this down somewhere so you don’t forget it. If you do, it’s not the end of the world, you’ll just have to reboot to reset it from a change.

Spoofing a MAC address
To spoof your MAC address, you simply set that value returned from ifconfig to another hex value in the format of aa:bb:cc:dd:ee:ff

For this example, we will set our wireless MAC address to 00:e2:e3:e4:e5:e6 by issuing the following command:
sudo ifconfig en1 ether 00:e2:e3:e4:e5:e6

The sudo command will require that you enter your root password to make the change.

Verifying the Spoofed MAC address worked
If you want to check that the spoof worked, type the same command as earlier:
ifconfig en1 | grep ether
Now you will see:
ether 00:e2:e3:e4:e5:e6
Meaning your MAC address is now the value you set it to. If you want to further verify the spoof, simply login to your wireless router and look at the ‘available devices’ (or attached devices) list, and your spoofed MAC address will be part of that list.

If you want to set your MAC address back to its real value, simply issue the above ifconfig commands with the MAC address that you retrieved in step 1. You can also reboot your Mac.

Enjoy!

Note: Reader Dee Brown points out the following, which may help with some users having difficulties: “running 10.5.6 you need to do the trick to disassociate from the network. ****DO NOT TURN AIRPORT OFF****. What you will have to do is click your airport and click join network and enter some bogus name as the network ssid. Then while it’s trying to connect click cancel.At this point you may spoof using the sudo ifconfig en1 ether command”

other reads point out that Dee Brown’s trick works in 10.5.7 and above too. Thanks Dee!

Update: If you’re still having problems with MAC address spoofing in Leopard or Snow Leopard, the above method still works but try disassociating with any wireless network BUT keep your wireless Airport on (as mentioned above) – an easy way to do this is to type the following in the command line:

airport -z

Note that you have to have the ‘airport’ command setup to work for users, you can do that by copy and pasting this command into the Mac Terminal:

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport

Once disassociated from the network you should be able to spoof your MAC address as usual

//from osxdaily.com

Oct 14

How to Scan a Windows Network for Conficker Virus from Mac OS X

» IT, Mac «

Mac users are largely immune to the world of virus and trojans, but it’s not uncommon for you to be a Mac user in a LAN sea of Windows PC’s. The Conficker Virus is Windows only but it’s garnering a lot of attention, so if you’re on a Windows LAN at home, work, or school, you may want to check if the Windows machines are vulnerable or infected with Conficker. You can do this from your immune Mac OS X machine pretty easily with a cool command line utility called nmap. Here are the steps:

1) First you need to install the command line tool nmap, you can download the OS X install package from the official nmap site here. I recommend downloading the latest beta version to have the most up-to-date scanning scripts.

2) Use nmap to search your LAN for vulnerabilities to Conficker by using the following command:
nmap -PN -T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.0.1-254
Note: Be sure to substitute the IP range for your LAN, so this may be something other than the IP range above, like 10.1.1.10-100

3) Examine the output of nmap, you are looking for something like this to tell if you have a problem:
Host script results:
| smb-check-vulns:
| MS08-067: FIXED
| Conficker: Likely INFECTED
|_ regsvc DoS: VULNERABLE

If you find a Windows PC that is likely infected, you can follow the following two Microsoft knowledge-base articles to help you out: Protection from Conficker for Consumers and Conficker Protection for IT Professionals – we won’t cover the details here because this is a Mac site.

Nobody really knows if Conficker is dangerous or not, but we’ll all likely find out soon as April 1st is some mystery execution date – it could be a joke or the Windows world could explode into calamity, we’ll see. You can read more about the nmap Conficker scan script we reference above here.It’s worth mentioning that you can install nmap with MacPorts, but the version included in MacPorts is nmap 4.60 and does not contain the script we want to use for this scan, which is why I recommend installing the latest beta version (as of now, nmap 4.85b5).

Oct 13

Macintosh terminal parancsok

uptime : uptime:)

last reboot : újraindítás history; ugyan ez shutdown-nal is jó (last shutdown); illetve user history, last %username% pl.: last imi

sudo mdutil -a -i off  : snow leo alatt spotlight kikapcsolása, ugyan ez ‘on’-al bekapcsolás

time cat : stopper, ctrl+c megszakítja a futást

DMG-ISO ISO-DMG kovertálás…
Convert a DMG file to ISO
hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso

Convert an ISO file to DMG format
hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg

Show all DHCP information
ipconfig getpacket en1

flushDNS
dscacheutil -flushcache

mail with sendmail
:

Oct 13

SMB mount Terminal (Command line)

» IT, Mac «

from osxdaily.com:

OS X Daily reader Dan Luna sent in the following tip on accessing Windows shares on the Mac from the command line: “My Mac is nestled into a sea of Windows PC’s at the office, and so I am frequently accessing SMB shares to share data and files. Accessing SMB/Windows shares on the Mac is really easy from the GUI but I spend a lot of time in the command line and I always like to find a way to do things using the underpinnings of Mac OS X. With this in mind, here’s how to access SMB shares via the command line in OS X:”

This first command lists the available shares at the destination IP:
$ smbclient -U user -I 192.168.0.105 -L //smbshare/

Now you’ll want to pass set your SMB shares mount point:
$ mount -t smbfs -o username=winusername //smbserver/myshare /mnt/smbshare

and finally you’ll want to gain access to the SMB share by specifying your Windows login and the machines IP address:
$ mount -t cifs -o username=winusername,password=winpassword //192.168.0.105/myshare /mnt/share

Thanks for the tip Dan! I haven’t been able to check if this works because I’m on an all Mac network, but the commands seem valid so I see no reason it wouldn’t. Obviously you’ll need to fill in your own unique usernames, sharenames, IP addresses, mount points, etc.

I really appreciate Dan’s tip but I think I’ll just stick to the GUI myself…

« Previous PageNext Page »