-
Posts
1235 -
Joined
-
Last visited
-
Days Won
58
Content Type
Profiles
Articles, News and Tips
Forums
Everything posted by Leon
-
Hi, Great news, development of EDP version 3.x have today been halted and the development of version 4.x have started. Some of the things we are looking to integrate in version 4.x 1. Global SVN server for faster access for everyone 2. Mysql databases for generating plist files 3. On-the-fly plist generation 4. Better support for large amount of models 5. Faster and better code. Stay tuned! ----- To follow the development of version #4 - do like this: cd / mv /Extra /Extra.old mkdir /Extra cd /Extra svn --non-interactive --username osxlatitude-edp-read-only --force co http://osxlatitude-edp.googlecode.com/svn/trunk . NOTICE THE LAST --> .
-
Hi, Great news, development of EDP version 3.x have today been halted and the development of version 4.x have started. Some of the things we are looking to integrate in version 4.x 1. Global SVN server for faster access for everyone 2. Mysql databases for generating plist files 3. On-the-fly plist generation 4. Better support for large amount of models 5. Faster and better code. Stay tuned!
-
Mirror of: http://osxdaily.com/2012/08/02/improve-tab-completion-in-mac-os-x-terminal/ Tab completion is a wonderful feature of shells that make power users lives easier, letting you automatically complete commands, paths, file names, and a variety of other things entered into the command line. It works great as is but you can make it even better by enabling a few features; ignore caps lock and casing of commands when completing, remove the necessity to double-tap the Tab key if something is ambiguous, and last but certainly not least, cycle through a menu of all possibilities rather than dumping a humungous list if there is ambiguity. If you don’t regularly use the OS X Terminal (or a linux terminal) you probably don’t have a use for this tip. Launch Terminal and be in the home directory to get started: Using emacs, nano, vi, or whatever your favorite text editor is to edit .inputrc, we’ll use nano for the walkthrough: nano .inputrc Paste in the following three rules on unique lines: set completion-ignore-case on set show-all-if-ambiguous on TAB: menu-complete Hit Control+O to save changes to .inputrc followed by control+X to quit Open a new Terminal window or tab, or type “login†to open a new session with the rules in effect Start typing a command, path, or something else and hit the Tab key to see the improvements firsthand This has been tested to work with bash shell and should work with any version of Mac OS X. If you enjoyed this, don’t miss our other command line tips and tricks.
-
Microsoft has made available Windows 8 Enterprise edition 90-day trial for those who want to get their hands on Windows 8 and do not have a MSDN or TechNet subscription. This trial is available in 32bit and 64bit flavors and come in several languages. "This evaluation provides a 90-day trial of Windows 8 Enterprise edition. Both 32-bit and 64-bit versions are available as ISO images in the following languages: Chinese (Simplified), Chinese (Traditional), English, English (UK), French, German, Italian, Japanese, Korean, Portuguese (Brazil), and Spanish. In order to use this evaluation, you must register and the product must be activated online with Microsoft-hosted activation and validation services. Microsoft does not provide technical support for this software," Microsoft states. Microsoft is making this trial available for developers who are building Windows 8 apps and IT professionals who want to test out Windows 8 to see if it is suitable for their organization. Source: MSDN Evaluation Center Download Link: Windows 8 Enterprise 32bit Trial Windows 8 Enterprise 64bit Trial
-
I was using ClearOS 5.2, but I believe these steps will probably also work for ClearOS 5.1? A couple things to keep in mind about my notes. a) I had ClearOS setup as a gateway with two NICs. Due to other VMs on Hyper-V I am using eth0 as the LAN and eth1 as the WAN. ClearOS seems to default to the reverse and if you followed that convention you'll need to reverse some of the things I'll document below. For my notes below I did this from a fresh install of ClearOS 5.2. If you've already been using ClearOS for a while you may need to do things a little differently than what I'm describing here. In general you want all the configurations I mention to have "ethX" instead of "sethX" with the exception of /etc/iftab c) If you see "sethX" during the boot process then you're missing one of these configuration steps. d) I used the Microsoft Version 2.1 Release Candidate driver as I have a 4 CPU system. In using the current Microsoft Version 2.0 driver my system hung during the boot process. I found that by changing the Hyper-V configuration to 1 virtual CPU the boot completed. If you would rather only use non-Beta code I believe that in using a single CPU the other steps I mention here should all work for you. e) There are several places in which the Ethernet Hardware (MAC) address is specified. I don't know what restrictions there are (if any) for Ethernet specs, Hyper-V, and/or Linux on valid MAC addresses. Keep in mind that whatever value you choose it needs to be unique in your network. Other than that I believe that any value from 0x000000000000 to 0xFFFFFFFFFFFF should work? You'll also need to ensure that the same value is used in the two or three places it must be specified. (I coded it in the ifcfg-XXX files, but it may not be absolutely necessary to include it there?) f) In researching my problems I was reminded that Linux doesn't necessarily activate hardware devices in the same order each time. Thus it might be possible for eth0 and eth1 to be physically reversed from one boot to another. I don't know if that could be an issue with ClearOS or not? But I suspect the fact that the MAC address is specified should ensure that eth0 and eth1 are always the same physical interface from one boot to another? g) Before following these steps you'll want to install ClearOS and get it working on Hyper-V. Verify that all your IP addresses are working, i.e., PING them from another host. And verify that all other software is functioning correctly. I believe it is better to be current on maintenance. So I'd also recommend that you update all software, both to ClearOS and Hyper-V, before trying to install this Microsoft driver. h) Of course be sure you backup any critical data before attempting this. Just in case something goes wrong. In trying to find the best way to install and configure everything I had one erroneous variation in which neither NIC came up and I had trouble stopping the ClearOS boot process to try and get into a terminal session. I ended up re-installing ClearOS and starting over as I couldn't connect through the web interface on the Hyper-V console for this ClearOS VM. i) One IMPORTANT POINT to keep in mind is that because you're making changes to the Ethernet configuration you probably won't be able to connect to the VM from outside with something like PuTTY. You'll need to use a remote connection to the Hyper-V console and use that terminal to make these changes. j) I tried several variations to the process, but I couldn't find any way to install the driver and make all the configuration changes and just re-boot once. Because you have to make hardware changes to the Hyper-V NICs it appears that you need to boot once after the driver is installed and with the new (synthetic) NICs. Then make the configuration changes and boot a second time at which point everything should be working normally. k) I'm not a Linux guru, but it appears to me that whatever ifcfg-XXXX files are found by Linux it attempts to start these interfaces. There also seem to be several variations on how these configuration files can be coded. I saw it coded both with and without double quotes around the various parameters. Various ClearOS scripts seemed to make modifications to these files. I tried a number of options before finding this method that worked, but in doing so I may have added some options to this file that ClearOS would not have on its own. I don't know if that could cause any problems for ClearOS or not? But if you have trouble afterwards you might want to see if you are missing any parameters the original ifcfg-XXX files originally had in them or if you've added any parameters that they didn't have. (Or perhaps used a different syntax than what was there before.) Since my steps below are from a clean install I didn't have an existing ifcfg-XXXX file, but you might want to make a backup copy of the files you have first. Something in the process of trying to configure the system would wipe out those files and a backup will help to ensure you get back to your prior (working) network configuration. These are located in the directory /etc/sysconfig/network-scripts ifcfg-eth0 - DEVICE=eth0 TYPE=â€Ethernet†ONBOOT=â€yes†USERCTL=â€no†HWADDR=â€00:15:5d:01:76:a2†BOOTPROTO=â€static†IPADDR=â€192.168.2.5†NETMASK=â€255.255.255.0†GATEWAY=â€192.168.7.1†ifcfg-eth1 - DEVICE=eth1 TYPE=â€Ethernet†ONBOOT=â€yes†USERCTL=â€no†HWADDR=â€00:15:5d:01:76:a3†BOOTPROTO=â€static†IPADDR=â€192.168.7.5†NETMASK=â€255.255.255.0†GATEWAY=â€192.168.7.1†Here are the steps I took to get this Microsoft driver working. With some slight variations these first steps I believe are common to any derivative of Red Hat? Prior to executing these steps you'll want to modify Hyper-V to have the Microsoft driver ISO file in the virtual DVD drive. yum groupinstall "Development Tools" yum update (Get current on maintenance) mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom cp -rp /mnt/cdrom /opt/linux_ic umount /mnt/cdrom cd /opt/linux_ic ./setup.pl drivers If the Microsoft driver setup runs correctly you should get something like this for your result. # ./setup.pl drivers Checking if required components are installed...done. Installing Linux integration components (vmbus, enlightened ide, enlightened scsi and network drivers) for Hyper-V... Building all modules... Building modules, stage 2. done. Your system supports the timesource driver, including driver in the build Installing vmbus driver...done. Installing netvsc driver...done. Installing storvsc driver...done. Installing blkvsc driver...done. Installing hv_timesource driver...done. Updating module dependencies. This may take a while...done. Installing various udev rules and scripts...done. Updating initrd image... Backing up /boot/initrd-2.6.18-194.8.1.v5.img to /boot/initrd-2.6.18-194.8.1.v5.img.backup0 Done. Updated /boot/initrd-2.6.18-194.8.1.v5.img Updating grub conf file... Done. Installing vmbus startup script... *** The drivers have been installed successfully.*** [ OK ] To continue ... # lsmod | grep vsc (This verifies that the Microsoft drivers loaded. My result is shown below.) storvsc 33700 0 vmbus 52168 1 storvsc scsi_mod 141908 8 storvsc,ib_iser,iscsi_tcp,libiscsi2,scsi_transport_iscsi2,scsi_dh,libata,sd_mod shutdown –h now At this point you need to modify the Hyper-V configuration. Remove the Microsoft driver from the virtual DVD drive. Delete your existing Legacy Network cards and add back in a "Network Adapter," i.e., the synthetic NIC that the Microsoft driver will communicate with. Specify a static MAC address. Once that is done boot the ClearOS VM. If you're doing this from a clean install of ClearOS no ethX or sethX message should show up during this boot. If you get any sethX messages ClearOS is likely to say FAILED. But once you've made the following configuration changes everything and booted the VM a second time then everything should be working. cd /etc/sysconfig/network-scripts You'll need the ifcfg-ethX files. Depending upon the exact steps you follow you may have both ifcfg-ethX and ifcfg-sethX files. If so the sethX files can be deleted. Use nano to edit the ifcfg-ethX (an example configuration is shown above) and ensure that this configuration matches your network, i.e., correct IP address, router (gateway) address, hardware (MAC) addresses, etc. If you only have ifcfg-sethX files rename them to ifcfg-ethX and then modify them as appropriate (see example above). cd /etc/init.d nano ifrename This newly created file should contain the following: ifrename -i seth0 -n eth0 ifrename -i seth1 -n eth1 chmod 755 ifrename (make the ifrename file executable) I don't know a lot about the Linux boot process, but basically this next command creates a link that is picked up at the appropriate time in the boot process to rename the sethX interfaces (which are created due to installing the Microsoft driver) to ethX which is something that the ClearOS system will recognize. Without doing this a number of the ClearOS webpages were not functioning correctly (see my prior post). ln -s /etc/rc.d/init.d/ifrename /etc/rc.d/rc5.d/S09ifrename cd /etc nano iftab This newly created file should contain the following. This is the only place in your configuration where you should have sethX instead of the more usual ethX. This is one of three places in which the Ethernet hardware (MAC) address is specified. (The other two are in the Hyper-V virtual NIC configuration and in the ifcfg-ethX files.) # LAN Interface seth0 mac 00:15:5D:01:76:A2 # WAN Interface seth1 mac 00:15:5D:01:76:A3 cd /etc/init.d nano network CNTL-W to find VLAN (This is a nano search command to jump to the right place in this file.) You should see the following in this "network" file - # Even if VLAN is configured, without the utility we can't do much [ ! -x /sbin/vconfig ] && VLAN= Just below this point, i.e., after the equals sign, you'll want to add the following code. if [ -x /sbin/ifrename ] && [ -r /etc/iftab ]; then echo -n "Remapping network interfaces name: " ifrename -p echo "done." fi If you've done a fresh install of ClearOS at this point you should be able to reboot and everything should be working. If you've been running ClearOS for a while there is one other thing you should double check to ensure the firewall is configured correctly. If the firewall is not configured correctly you'll not be able to PING from an outside host and from inside the VM you'll get an error message (see my prior post). (Since it doesn't take long to check the firewall configuration you may want to do this even if you've performed a clean install.) cd /etc nano firewall Verify the following is coded. In some cases something in a ClearOS script seemed to be clearing these values to "". On one occasion something I did caused a ClearOS script to fill in sethX instead of ethX. EXTIT=â€eth0†LANIF=â€eth1†This next command (shutdown) will reboot your ClearOS VM. During the boot process you should see some messages (such as VMBUS) which are related to the Microsoft drivers. You should also see eth0 (and if you've got a gateway eth1) as OK during the boot process. If you see sethX one of the above configuration steps was somehow missed. After you correct it and reboot everything should be working. Once the Microsoft driver is installed one benefit you'll see is that from the Hyper-V manager you can click the "Shutdown" button and instead of getting an error dialogue box back after a few minutes you'll see that ClearOS VM is shutting down gracefully. shutdown –r now In a prior post I mentioned getting the error message, "Remapping network interfaces name: Warning: interface name is 'eth0' at line 2, can't be mapped reliably" This was occurring because I incorrectly coded ethX in the iftab file rather than sethX. Enjoy.
-
When installed on a virtual machine that is running a supported Linux operating system, Linux Integration Services for Hyper-V provides the following functionality: Driver support for synthetic devices: Linux Integration Services supports the synthetic network controller and the synthetic storage controller that were developed specifically for Hyper-V. Fastpath Boot Support for Hyper-V: Boot devices now take advantage of the block Virtualization Service Client (VSC) to provide enhanced performance. Timesync: The clock inside the virtual machine will remain synchronized with the clock on the host. Integrated Shutdown: Virtual machines running Linux can be shut down from either Hyper-V Manager or System Center Virtual Machine Manager, using the "Shut Down" command. Symmetric Multi-Processing (SMP) Support: Supported Linux distributions can use up to 4 virtual processors (VP) per virtual machine. 1. Download Linux Integration Components v2.1 a. Download Linux Integration Components v2.1 from Microsoft Download site. b. Extract the .exe file into a temp folder. You will need only LinuxIC v21.iso file. c. Place the LinuxIC v21.iso file into your VM host server where you can mount the ISO as a CDROM for your Centon Virtual Machine. 2. Installation You will need Development Tools installed to be able to compile the Integration Components. You could do that by running yum: yum groupinstall "Development Tools" NOTE: This command will try to use your network connection to download and if you used Synthetic Network Adapter for your Hyper-V machine you will not have internet connection. So make sure to install Development Tools during your Centos initial installation. Now make sure you added LinuxIC v21.iso file to your Hyper-V CDROM as Image. As the root user, mount the CD in the virtual machine by issuing the following commands at a shell prompt: mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom Copy Linux Integration Services to the virtual machine and unmount CDROM that no longer needed: mkdir /opt/linux_ic_v21_rtm cp –R /mnt/cdrom/* /opt/linux_ic_v21_rtm umount /mnt/cdrom As the root user, run the following command to compile and install the synthetic drivers: cd /opt/linux_ic_v21_rtm/ make make install NOTE: If you're using the x64 version of Centos, you have perform an extra step. Attach the Centos ISO that was used for installation in the virtual machine, and mount it: mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom Install the adjtimex RPM for more accurate time keeping in the virtual machine: rpm –ivh /mnt/cdrom/Centos/adjtimex-1.20-2.1.x86_64.rpm To verify that all subcomponents are running,, as the root user, issue the following command at a shell prompt: /sbin/lsmod | grep vsc Please remmeber when using Network Adapters on Hyper-V, NIC names would be changed from eth0 to seth0. Uninstalling Linux Integration Services To uninstall Linux Integration Services, follow these steps. 1. From the Linux virtual machine, browse to the location where the installation files were copied (for example, /opt/linux). 2. From the command line, run the following command: make uninstall 3. Open /boot/grub/menu.lst or /boot/grub/grub.conf and remove the noprobe entries from the boot entries. 4. Restore the initrd image to the original file. For example: To configure the Synthetic Storage Controller: cp /boot/initrd-2.6.16.60-0.54.5-smp.backup0 /boot/initrd-2.6.16.60-0.54.5-smp5. Reboot the virtual machine.
-
Hi, I recently upgraded my Dell D430 to run OSX Lion - and with that i noticed that coolbook no longer is working. The problem lies within AppleACPIPlatform.kext in Lion and the solution is to replace it with the one from Snow Leopard 10.6.7 Howto fix it: 1. Download kexthelper 2. Download AppleACPIPlatform.kext from 10.6.7 3. Extract both to desktop 4. Use kexthelper to install AppleACPIPlatform.kext 5. Reboot 6. Reinstall coolbook Enjoy!
-
Orginal post: Interworks In case you didn't know, if you install Google Chrome by downloading and installing fromhttp://www.google.com/chrome, Chrome will install itself to the AppData folder for ONLY the user that installed the folder. The install directory is located at: For Windows Vista/Windows 7 - C:\Users\%username%\AppData\Local\Google\Chrome\ For Windows XP - C:\Documents and Settings\%username%\Local Settings\Application Data\Google\Chrome\ For Window's Server 2003 if an individual user wants Google Chrome, they can simply go tohttp://www.google.com/chrome and install Chrome. However, that option no longer works for Window's Server 2008 without prompting for an administrator password (at least that's the case with the multiple terminal servers that I've tried). So let's say you want to install Google Chrome on a terminal server for every user so you no longer have to worry about prompting for an administrator password. How would you go about this? In older versions of Google Chrome and in Windows Server 2003, you could copy and app data folder from the user and dump it in the all users folder and create a shortcut to the executable file. However, this no longer works in Windows Server 2008 nor does it work with the newer versions of Google Chrome and Windows Server 2003. Luckily, there is a way to install Google Chrome on a terminal server (at least Windows Server 2008) to allow all users to have access without having administrator rights. By installing fromhttp://pack.google.com'>http://pack.google.com, Chrome will install itself in Program Files and make itself available to all users in Windows Server 2008. Google Pack is currently NOT compatible with Windows Server 2003. If you are the server administrator Chrome is already installed, you will need to uninstall Google Chrome and reinstall from http://pack.google.com for Chrome to install itself for all users. Once this has been done, the executable can be accessed via Program Files for all users. Step by Step Instructions for Windows Server 2008: Log on as an administrator Uninstall any previous versions of Google Chrome Web Browser Go to http://pack.google.com Select Google Chrome Web Browser Install (folder will be placed in Program Files) and a shortcut should be placed on the desktop for every user.
-
This guide will show you step-by-step how to install OSX 10.6 (Snow Leopard) in VMware 7 on Windows. Creds: * Thanx to "Vista Ultimate R2" on B.A for kicking this off -> http://betaarchive.co.uk/forum/viewtopi ... 12&t=10559 Hardware Requirements: * CPU with support for virtulization Stuff that you will need: * Vmware 7.x -> http://www.wmware.com for a free tria * WMware patcher -> Grap it from the bottom of the post.. * A retail version of MacOS Snow Leopard -> http://www.apple.com (Buy OSX, dont steal it, its to cheap to steal) Steps - Pre-installation: 1. Install Vmware 7 2. Unpack vmware patcher to c:\wmp 3. Open a dos console, if your using Win7/Vista, run cmd.exe as Administrator 4. Navigate to c:\wmp and run "setup.cmd install" (without the "") 5. Create a folder where you want to store the virtual machine.. eg. c:\osx 6. Copy the patch to c:\osx 7. Go into c:\osx using Windows explorer, and double click on "Mac OS X Server Snow Leopard.vmx" (This will now open up the virtual machine in OSX) 8. Connect the virtual CD/DVD to your retail dvd/iso 9. Create a new virtual SCSI disk and delete the one connected right now 10. Start your virtual machine and go thru the installation of OSX Snow Leopard Steps - After-installation: 1. Install "VMware Tools" by mounting darwin.iso as the drive of the virtual machine (This will fix graphics) 2. Power down the virtual machine, and set your network card to "nat" instead of Bridge (This will fix network) 3. For good sake, do a full update of OSX (more will come as i find more fixes etc.) Files: VMware_patcher.zip
-
Note: Mac OSX 10.5.x “Leopard†may not need this - however some users have reported it still adds value. Apple seem to have made some changes in the way Leopard interacts with the file system making automatic refreshes far more instant. A small but annoying thing about Mac OSX is that sometimes it doesn’t refresh itself when a file or folder is changed - especially when dealing with SMB (Windows) share drives. In Windows you can hit F5 to refresh the current Window, but Apple seemed to have forgotten to add this feature to Mac OSX. Well I searched the web and finally found an Applescript to do this which is here: tell application “Finder†tell front window update every item with necessity end tell end tell Now thats fine, but I wanted something that would tie into the Finder window. So I grabbed the refresh icon from a Firefox theme (GrApple) and made an Application Package in Script Editor. So here it is for people that want it: Download: Finder-Refresh-1.4.zip To install: 1. Unzip to your Applications Folder * 2. Open a Finder window. 3. Go to Applications and scroll to “Finder Refresh†4. Left-click & drag Finder Refresh to the Finder window toolbar - you should see the other icons spread out. 5. Let go of the mouse button and there you go - should look like below. * If your web browser auto-unzip’s (ie Safari) then “Finder Refresh†will be in your download directory so you can skip Step 1 From then on just click the button to refresh the currently open Finder window. It works for me, and now one small thing no longer annoys me. Uninstallation: To Remove from the Finder Window, Hold down the Command/Apple key, left click on the icon and drag off the Finder Window - you’ll see your mouse cursor turn into a cloud, at this point let go of your mouse button. Done!
-
If you get error like this one Error 400 Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit. That means that your browser is trying to send too much at once. Probably, it’s size of the cookies. The easy way to fix it – delete cookies. Of course, you lose all info in the cookies, but at least you can access site again. If you develop/manage web site and your customers complain of this error message – there are two things to do: Review cookies and limit the size of cookies your application stores in the browser. Increase allowed request size in web server configuration To increase request size in Apache, add directive LimitRequestFieldSize to the configuration file. Default value is 8190 bytes - to increase it 2 times add LimitRequestFieldSize 16380 Apache restart is required.
-
Recently, I read a hint about how to use Automator to execute a shell script to open a screen sharing session to another machine. It turns out that there is a much simpler (and faster) way to accomplish this. Open a screen sharing session to the desired host. Notice the small icon in the middle of the title bar of the screen sharing session. Click on the icon and drag a copy to your desktop. Close the screen sharing session. Click on the icon you dragged to the desktop. It should open a connection to the desired host. You can rename the icon or add graphics to the icon as desired. Note that this method opens the session much more quickly than the Automator shell script method.
-
Microsoft has introduced together with Windows 2008 a new Hypervisor called Hyper-V. Initially Microsoft only supported Microsoft products and Novell Suse, but recently they added support for Red Hat Enterprise Linux. With this support it is also possible to install the components on CentOS. 1. Download Latest Linux Integration ComponentsYou can download the exe file here. Extract it and copy the linuxic.iso somewhere you can mount it as a cdrom on your Virtual Machine. 2. InstallationTo install the drivers we need the development tools. Easiest method to install those is via Yum. yum groupinstall "Development Tools" Next we will copy the contents of the cdrom to the server mkdir -p /mnt/cdrom mount /dev/cdrom /mnt/cdrom cp -rp /mnt/cdrom /opt/linux_ic umount /mnt/cdrom Let's create a new initrd image with the nessecary drivers. cd /opt/linux_ic ./setup.pl drivers When this is finished you can safely shutdown the virtual machine and add the synthetic adapters (Network, SCSI, ...). Once the machine is booted and logged in in you can verify the installation of the drivers with following command: lsmod | grep vsc netvsc 73704 0 storvsc 66824 0 blkvsc 70440 3 vmbus 86120 3 netvsc,storvsc,blkvsc scsi_mod 196569 6 scsi_dh,sg,storvsc,blkvsc,libata,sd_mod If you installed a synthetic Network Adapter you can verify with ifconfig -a and check if there is seth0.
-
I know that all of the vi people are going to blast me for this but I like nano much better for quick and dirty editing. So when it comes to editing the crontab here is a quick way to change the terminal editor. EDITOR=nano crontab -e You should be able to substitute any editor in the place of NANO, Mac OS X has PICO which I think is the same as nano.
-
This script works like chkconfig, but uses update-rc.d in the background for adding and removing system services on a Debian system. I hope some users like this! #!/bin/sh # Description: This script works like chkconfig, but uses update-rc.d in # the background for adding and removing system services on a Debian system. # # Examples: # chkconfig --add name_of_the_service # chkconfig --del name_of_the_service # # Not working: chkconfig 2345 80 20 # For using this on your own system add a file called 'chkconfig' with # this content in the /sbin/ folder on your harddrive and # run once this command: chmod +x /sbin/chkconfig # Variables SERVICE=$2 # Functions add() { if [[ `ls -a /etc/init.d/ | grep -e "^$SERVICE$"` ]] then echo -n "Adding service: $SERVICE" echo /usr/sbin/update-rc.d $SERVICE defaults else echo -n "File /etc/init.d/$SERVICE not found." echo fi } delete() { if [[ `ls -a /etc/init.d/ | grep -e "^$SERVICE$"` ]] then echo -n "Removing service: $SERVICE" echo /usr/sbin/update-rc.d -f $SERVICE remove else echo -n "Error removing: service does not exist." echo fi } # Exactly two parameters required if [[ $# != 2 ]] then echo -n "Usage: $0 {--add|--del} name_of_the_service" echo exit 1 fi # Check the command line for actions case "$1" in "--add") add ;; "--del") delete ;; *) echo -n "Usage: $0 {--add|--del} name_of_the_service" echo exit 1 esac exit 0 esac exit 0 Should make life easier for some hardworking debian admins out there... enjoy! //Leon
-
Sometimes it can be a bloody hell to find out whats eating up storage space on a linux machine... Try this one out.... # find / -type f -size +20000k -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nrk 2,2 It will give you a list of files larger than 20mb, sorted by size... Enjoy!
-
A friend of mine asked how he could generate a .htpasswd file for use with Apache. The solution is quite simple, just run this from a console... Q. How do I use htpasswd command to store username and passwords? A. htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. If htpasswd cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes. Create a new password fileFollowing command will creates a new file and stores a record in it for user jerry. The user is prompted for the password. If the file exists and cannot be read, or cannot be written, it is not altered and htpasswd will display a message and return an error status. # htpasswd -c /home/pwww/.htpasswd jerry Change or update passwordTo add or modifies the password for user tom, enter: # htpasswd /home/pwww/.htpasswd-users tom The user is prompted for the password.
-
Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let your visitors submit a blog post to Digg you need to get that same exact URL. There are plenty of other reasons as well. Here is how you can do that. Add the following code to a page: <?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?> You can now get the current page URL using the line: <?php echo curPageURL(); ?> Sometimes it is needed to get the page name only. The following example shows how to do it: <?php function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } echo "The current page name is ".curPageName(); ?> .. enjoy!
-
Hi, So, malin (my wife) had a problem today with a remote tracker script from www.susnet.se dident work because their server is down, this caused her blog to load extremely slow. The solution was quite simple, instead of loading the susnet code in the middle of her site, we would load the susnet code AFTER the page have loaded using a OnLoad event. The change look like this. 1. Change to 2. Create a new javascript at the end of the page like this <script> function doneLoading() { loadSusnet(); } </script> The above function will call yet another function called "loadSusnet" 3. Create the LoadSusnet javascript function and the end of the code.. like this.... <script> function loadSusnet() { var scriptSusnet1 = document.createElement('script'); scriptSusnet1.type = 'text/javascript'; scriptSusnet1.src = 'http://susnet.se/susnetstat.js'; document.getElementsByTagName('head')[0].appendChild(scriptSusnet1); susnet_counter_id = 60529; //susnet_security_code = '76388' susnet_node=0; register(); var scriptSusnet2 = document.createElement('script'); scriptSusnet2.type = 'text/javascript'; scriptSusnet2.src = 'http://susnet.se/susnetstat.js'; document.getElementsByTagName('head')[0].appendChild(scriptSusnet2); susnet_counter_id = 60529; //susnet_security_code = '76388' susnet_node=0; getTotalUniqueVisitors(); } </script> What the susnet function does is to dynamically load the remote javascript files, all this is done AFTER the page have rendered, hence the page now loads ALOT faster... - offcourse, this should be used wisefully.
-
Following is a guide for howto install the nginx load balancer on CentOS... Lets start by installing the requirements.. type: sudo yum install -y pcre yum install pcre-devel zlib zlib-devel openssl openssl-devel gcc Now that we got what is needed, lets fetch nginx and install it.. 1. wget http://sysoev.ru/nginx/nginx-0.5.35.tar.gz 2. tar xzvf nginx-0.5.35.tar.gz 3. cd nginx-0.5.35 5. ./configure --sbin-path=/sbin/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1 6. make 7. make install Now you should have nginx installed and just need to configure it...
-
So, with the re-launch of http://www.gog.com/ i found my self wanting to run some games (in this case Master of Magic) on OSX... Knowing that i offcourse just could load up a virtual machines in VMware fusion, it just seemed like over kill. So, after a bit of googling, i found my new best friend... DOSBox -> http://www.dosbox.com/ When first started you get a plane empty dos console *sweeet*, so to load up a game.. i did like this: 1. Create a folder somewhere, call it eg. "dos" (without the "", this will be your new C:) 2. In the dos console, type "mount C /dos" Now we have a C drive, that also is a folder we can access in osx *sweet*, so i copied over MOM and ran magic.exe... .. and .. PROFIT! Do do you know of any solution that works better ?
-
I was doing a bit of work on my blog that is hosted on a OSX server, when i came to the point that needed to import a meta variable in javascript.. so i made this little function... <script> function getMeta(varname) { var metas = document.getElementsByTagName('META'); var i; for (i = 0; i < metas.length; i++) if (metas[i].getAttribute('NAME') == varname) break; var GMresult = metas[i].getAttribute('CONTENT'); return GMresult; } </script> You can test it by doing: <script> var result = getMeta("Content-Type"); alert(result); </script> ... It should popup a javascript alert with the content of Content-Type
-
Hi, So, today i wanna talk a bit about howto keep your mac clean and free up space, offcourse - a mac like any other computer ends up getting clutered and filled up with .. well. .crap! * Clean out the updates folder Sometimes the updates folder dosent get cleaned automaticly after installing updates, navigate to /Library/Updates, if there is anything in there.. remove it... * Remove old .ipsw files If you own a Ipod/Ipad/Iphone then you have most likely also installed updates at some point - its safe to remove the old .ipsw files (firmware), those can be found in : /Users//Library/Application Support/iTunes/iPod Firmware * Empty Trash Just because you delete a file, dosent mean that the file actually leave your harddisk and space is freed, in OSX the file record container is just changed to point the file the "Trash", so remember to empty your trash (yes, i know that not even then is the file fully removed from the Harddisk.. but thats another talk for another day) * Removed un-used applications My motto.. if you dont use.. why keep it ? .. removed un-used applications and safe alot of space ... (more to come as i find more stuff todo) .. ... Usefull tools ... There is alot of usefull tools out there that can do alot of stuff for you also... * CleanMyMac -> http://www.macpaw.com/cleanmymac Neat application that easily can free up some harddisk space * Monolingual -> http://monolingual.sourceforge.net/ Removes un-used languages, can easily free up space .. and its opensource * Xslimmer -> http://www.xslimmer.com/ Xslimmer removes un-used code from your applications.. eg. code that supports that the application can run on powerpc, use with care and remember to backup first * iDefrag -> http://www.coriolis-systems.com/iDefrag.php OSX's file system gets fragmented to, use this application to optimize the performance of your Harddisk.... How do you keep your OSX clean ?.. leave a message....
-
I manage a couple of ClearOS servers, and sometimes the usual "top" just isent enough.. thats where htop comes in. Since htop is not in the package directory of ClearOS, you have to work-around it.. 1. Login as root on your COS 2. do -> wget http://packages.sw.be/htop/htop-0.8.3-1.el5.rf.i386.rpm'>http://packages.sw.be/htop/htop-0.8.3-1.el5.rf.i386.rpm [ENTER] 3. do -> rpm -i http://packages.sw.be/htop/htop-0.8.3-1.el5.rf.i386.rpm Wolla.. you know have htop .. simply type htop to start it...
-
When installed on a virtual machine that is running a supported Linux operating system, Linux Integration Services for Hyper-V provides the following functionality: Driver support for synthetic devices: Linux Integration Services supports the synthetic network controller and the synthetic storage controller that were developed specifically for Hyper-V. Fastpath Boot Support for Hyper-V: Boot devices now take advantage of the block Virtualization Service Client (VSC) to provide enhanced performance. Timesync: The clock inside the virtual machine will remain synchronized with the clock on the host. Integrated Shutdown: Virtual machines running Linux can be shut down from either Hyper-V Manager or System Center Virtual Machine Manager, using the “Shut Down†command. Symmetric Multi-Processing (SMP) Support: Supported Linux distributions can use up to 4 virtual processors (VP) per virtual machine. 1. Download Linux Integration Components v2.1 a. Download Linux Integration Components v2.1 from Microsoft Download site. b. Extract the .exe file into a temp folder. You will need only LinuxIC v21.iso file. c. Place the LinuxIC v21.iso file into your VM host server where you can mount the ISO as a CDROM for your Centon Virtual Machine. 2. Installation You will need Development Tools installed to be able to compile the Integration Components. You could do that by running yum: yum groupinstall “Development Tools†NOTE: This command will try to use your network connection to download and if you used Synthetic Network Adapter for your Hyper-V machine you will not have internet connection. So make sure to install Development Tools during your Centos initial installation. Now make sure you added LinuxIC v21.iso file to your Hyper-V CDROM as Image. As the root user, mount the CD in the virtual machine by issuing the following commands at a shell prompt: mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom Copy Linux Integration Services to the virtual machine and unmount CDROM that no longer needed: mkdir /opt/linux_ic_v21_rtm cp –R /mnt/cdrom/* /opt/linux_ic_v21_rtm umount /mnt/cdrom As the root user, run the following command to compile and install the synthetic drivers: cd /opt/linux_ic_v21_rtm/ make make install NOTE: If you’re using the x64 version of Centos, you have perform an extra step. Attach the Centos ISO that was used for installation in the virtual machine, and mount it: mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom Install the adjtimex RPM for more accurate time keeping in the virtual machine: rpm –ivh /mnt/cdrom/Centos/adjtimex-1.20-2.1.x86_64.rpm To verify that all subcomponents are running,, as the root user, issue the following command at a shell prompt: /sbin/lsmod | grep vsc Please remmeber when using Network Adapters on Hyper-V, NIC names would be changed from eth0 to seth0. Uninstalling Linux Integration Services To uninstall Linux Integration Services, follow these steps. 1. From the Linux virtual machine, browse to the location where the installation files were copied (for example, /opt/linux). 2. From the command line, run the following command: make uninstall 3. Open /boot/grub/menu.lst or /boot/grub/grub.conf and remove the noprobe entries from the boot entries. 4. Restore the initrd image to the original file. For example: To configure the Synthetic Storage Controller: cp /boot/initrd-2.6.16.60-0.54.5-smp.backup0 /boot/initrd-2.6.16.60-0.54.5-smp5. Reboot the virtual machine.