-
Posts
1235 -
Joined
-
Last visited
-
Days Won
58
Content Type
Profiles
Articles, News and Tips
Forums
Everything posted by Leon
-
1. Watch grass grow 2. Watch paint dry 3. Watch water boil 4. Shop cloth with women 5. Be “do-it-yourself†dentist 6. Give yourself a bypass operation with an electrical bread knife (or plastic spoon) 7. Taking the term “fall and break a leg†seriously.. 8. Renovate house ?!?! 9. Stand in line in the supermarket 10. Parachute jumping.. without a parachute.. (irony or sarcasm might have been used here…) Whats your most interesting things todo ? //Leon
-
If you are still struggling on how to insert PHP Codes inside particular blog post, page or a widget sidebar for execution - then the following tutorial is for you. 1. Download: phpexec.txt.zip 2. Unzip and rename phpexec.txt to phpexec.php from here below... 3. Upload to /wp-content/plugins/ directory 4. Activate the plug-in from Wordpress administration menu Usage Anywhere in your post/pages where you want to execute a PHP Codes, insert before your php codes and your php codes. <phpcode> <?php echo "Current date and time: "; echo date("l dS of F Y h:i:s A"); ?> </phpcode> Security If you are running a blog with multiple users, you need to determine who can run this plug-in. Alter the settings in your Administration Menu. Options -> PHPExec Executing PHP codes in WordPress widget sidebar Installation Download php-code-widget.2.1.zip from below. Rename execphp.txt to execphp.php Upload to /wp-content/plugins/ directory Activate the plug-in from WordPress administration menu WIDGET: php-code-widget.2.1 Usage This plug-in work like a normal text widget except that it allows execution of PHP Codes. You can create up to 9 instances of this widget.
-
The Mac OSX Terminal can become slow to launch over time, but there’s an easy solution to speed it up again. By deleting the Apple System Logs, you can shave the lag in opening and launching new Terminal window/tabs dramatically, in my case from about a three second delay to instantaneous! Here’s how to delete the log files and gain your Terminal launch speed back: 1. Open Terminal 2. Type: sudo rm -rf /private/var/log/asl/*.asl 3. Hit ENTER, close the terminal and test again.. Wolla
-
Ever wondered if you could get rid of the spaces animation ? - from 10.6.x you can.. To disable the animation, do the following: Open /Applications/Utilities/Terminal.app. Copy and paste the following into the terminal window and then press enter: defaults write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock If you'd like to re-enable the animation, just do the following: Open Terminal and copy and paste the following into the terminal window and then press enter: defaults delete com.apple.dock workspaces-swoosh-animation-off && killall Dock Edit: Unfortunately, this only disables the "move directly to a space" animation that that is triggered by jumping to a space with a modifier-arrow key or modifier-number key or switching to a program in a different space. It does not disable the zoom-out/zoom-in animation for moving from spaces overview to a specific space. I use that method of transition fairly often, so it would be very nice if there was a switch for that one as well (or at least a way to speed up the animation).
-
Hi, Today i needed to test the functionality of a webdav server. Check out this: http://www.webdav.org/neon/litmus/ To use: 1. Download 2. compile 3. Use Type this: # wget http://www.webdav.org/neon/litmus/litmus-0.12.1.tar.gz # tar -zxvf litmus-0.12.1.tar.gz # cd litmus-0.12.1 # ./configure # make # make install # litmus http:// Simple and fast //Leon
-
I was just reading an blog post about pirate copying and decided to read a couple more, and i just can’t help be amazed about how freaking stupid the large organizations is, so let me help you and write a quick list for you. Why does people pirate copy: (Note, i am not saying that i pirate, simply stating the reasons) 1. We dont want to want to wait 3 months for a movie to come on a DVD when its been in the theaters 2. High Price, 200 SEK for a movie that you dont even know is good – is not worth it 3. Why do we have to buy a media to see a movie – how is that in anyway helping nature ? 4. Its time consuming to go and buy a movie vs. just downloading it.. 5. Some times its impossible to find a place to buy the movie or serie you want to see – downloading it the only option.. eg Startrek ? 6. Prices is not adapted to local pricing.. eg. a DVD sometimes cost the double in sweden as what it does in USA Why is it so hard just to make ONE online movie service where you can rent and see everything and make sure that everyone can use it. It escapes my mind why companies can’t get this into their thick skull, it does _NOT_ help to hunt down pirates and send them fines / send them to jail.. try solving the problem instead punishing people.. after all.. the people you punish is your customers.. What do you think ?
-
Hi,I just bought a WANSER-R / R3210 / USB NAS Dongle.. cool little fucker I have been using the NAS Adapter for a few days now and I am quite impressed. I am using the unit with a 200GB Hitachi SATA drive in an USB 2.0 enclosure and the adapter recognizes and uses the hard drive flawlessly. Over SMB I get speeds around 8MB/sec when using Ethernet and around 2MB/sec over Wifi, which is in line with the expected speed for those networks. The NAS adapter runs smoothly even under heavy load (4 torrents, uploading to the HDD via wifi and streaming a video off the drive at he same time is no problem). The unit is entirely controlled via a web interface and can act both as a DHCP client or server. Both SMB and FTP allow multiple users and access levels.The build in bit torrent client is reasonably fast and can handle up to 4 downloads simultaneously. Performance is quite solid and the unit is capable to resume downloads after a reboot (even though the manual claims differently). Overall I am quite impressed with this small device and was curious to find out what’s ticking on the inside. Unfortunately, the casing had no visible way of opening it and I didn’t want to break the small device, so I did some Internet research. The hardest part was to find the latest firmware, but here it is: Version 1.54 (G5S5020300154E2 L:1.20E): G5S5020300154E0.zip Version 1.59b (G5S5020300159B0): G5S5020300159B0.zip version 1.66a (from http://ulc.sudhop.com/): R3282_1_66a_NAS903.zip Just unpack it and follow the readme….Enjoy!
-
iCloud's 'Documents in the Cloud' doesn't let you do much except upload iWork files for use with iOS devices. To use those documents on another Mac, you have to download the file using the iCloud web interface. Poking around in the ~/Library folder, you can find a 'Mobile Documents' folder that is used for syncing iWork documents. But it turns out you are not limited to iWork files if you just want to sync between Macs (i.e. no iOS use). If you are using iCloud and have the 'Documents & Data' option selected in the preference pane, you can navigate to ~/Library/Mobile Documents. Depending on whether or not you've used iWork and synced documents to iCloud, you may or may not find folders there for each of the iWork applications (e.g. com~apple~numbers). This doesn't really matter. What is of use is that any files put into the ~/Library/Mobile Documents folder will automatically upload to iCloud and push to any other Mac you have that is signed in to the same iCloud account and has the 'Document & Data' iCloud preference checked. Lion even notifies you of version conflicts and allows you to resolve them when you open the document. While its not entirely like with mobileme - its one step in the right direction
-
What Happened to the Mail I Sent? UPDATE: Thanx to Philippe Mathot there is now a even easier solution - simply use the application below. Head over to OSX Latitude to get it: https://osxlatitude.com/index.php?/topic/375-how-to-request-read-receipts-in-mac-os-x-mail/ Have you ever wondered what happened to a message you sent? Has a spam filter's ruthless rule befallen it, or did it never arrive? Was it read but forgotten? When you send an email in Mac OS X Mail, the message will be delivered to its recipient promptly — usually, but not always. To get some idea of your every email's fate, you can request read receipts. Typically, the recipient will be asked to confirm the message has been opened. While this is no guarantee the content has been read or even understood, such read receipts can still be useful to rule out some possibilities of failure and maybe quiet a wandering mind. Request Read Receipts in Mac OS X Mail To make Mac OS X Mail request a read receipt for every message you send: Open Terminal. Type "defaults read com.apple.mail UserHeaders". Press Enter. If that command returns "The domain/default pair of (com.apple.mail, UserHeaders) does not exist": Type defaults write com.apple.mail UserHeaders '{"Disposition-Notification-To" = "Name "; }' replacing Name with your name and email@address with your email address. The complete line could read "defaults write com.apple.mail UserHeaders '{"Disposition-Notification-To" = "Heinz Tschabitscher "; }'", for example. If the "defaults read" command above returns a line of values that starts with "{" and ends in "}": Highlight the entire line. It might read something like {Bcc = "[email protected]"; }, for example. Press Command-C. Type "defaults write com.apple.mail UserHeaders '" (excluding the outer quotation marks). Press Command-V. Type "'". Insert '"Disposition-Notification-To" = "Name "; ' in front of the closing "}" character, replacing Name with your name and email@address with your email address. The line might now read defaults write com.apple.mail UserHeaders '{Bcc = "[email protected]"; "Disposition-Notification-To" = "Heinz Tschabitscher "; }' , for example. Press Enter. Not Only Request but also Respect and Send Read Receipts Unfortunately, Mac OS X Mail does not respect read receipts. If you get an email requesting a read receipt, nothing special happens. Using some JavaScript and Mail rules, you can mimic some of the behavior and send simple receipts upon request. These do not fully conform to the standard and will not be interpreted as read receipts by the sender's email program. Of course, the plain language acknowledgment of receipt will still be useful. Disable Automatic Read Receipt Requests Again in Mac OS X Mail To turn requesting a read receipt for every message back off: Execute "defaults delete com.apple.mail UserHeaders" at Terminal command prompt to delete all custom headers or set UserHeaders back to what it was before you added "Disposition-Notification-To". Full Email Accountability and Control For full knowledge and control over the fate of the emails you send, you can employ a certified email service.
-
You can use Debian on Hyper-V with 4 vCPU support. 1) Install a clean Debian 5.0.6 2) Do following: apt-get update aptitude update wget -c http://www.yusufozturk.info/linux/linux-image-2.6.36-hyperv-debian.x86_64.deb wget -c http://www.yusufozturk.info/linux/linux-headers-2.6.36-hyperv-debian.x86_64.deb apt-get install build-essential dpkg -i linux-image-2.6.36-hyperv-debian.x86_64.deb linux-headers-2.6.36-hyperv-debian.x86_64.deb echo -e "hv_vmbus\nhv_storvsc\nhv_blkvsc\nhv_netvsc" >> /etc/initramfs-tools/modules update-initramfs -u That’s it. Reboot your server with new kernel. Now you can use synthetic ethernet and 4 vCPU. Also integrated shutdown is available: You can use CPU stress tool for tests. UPDATE: For Debian 6 this kernel works: http://docs.homelinux.org/doku.php?id=using_linux_ic_with_debian_squeeze#using_hyper-v_linux_integration_components_with_debian_squeeze_64bit
-
Basically, you first create a share on your Linux/Windows for your Time Machine backups to go. I called mine "macbackup" and gave my user full permissions to the folder as well as set it to replicate so that I have a redundant backup of it. Next, open up a terminal window on the Mac and switch on the magic preference defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1 Now, mount the share on your Windows Home Server using Finder. Back in the terminal window, you now have to create a sparse bundle file. Take a look at the links above for more information, but basically you type a command like the following hdiutil create -nospotlight -library SPUD -size [size_in_gigs]g -fs HFS+J -type SPARSEBUNDLE -volname "Backup of [hostname]" -verbose [hostname]_[mac_addr].sparsebundle Replacing [size_in_gigs] for the size you want to constrain time machine to use, [hostname] for the machine name of your mac and [mac_addr] for the mac address of the interface you want to use for the bacup (usually eth0 as doing the backup over wifi will take a while) I used something like the following command: hdiutil create -nospotlight -library SPUD -size 250g -fs HFS+J -type SPARSEBUNDLE -volname "Backup of martinmbp" -verbose martinmbp_002332c5437e.sparsebundle Then copy this over to the mounted share using something like cp -r [hostname]_[mac_addr].sparsebundle /Volumes/mackbackup/. Now, go to System Preferences, Time Machine and select Change Disk.. Pick your WHS share that you have copied the .sparsebundle to and then leave for a long time if this is your first backup. Seems to be working for me. I'll report back and edit this answer if I find any issues with it. Mileage may vary as Apple obviously left this functionality out for a reason, I'm assuming it is a technical one rather than a ploy to sell more Time Capsules so we'll see what happens. Update: Been using for few days so far and seems to be working ok. A couple of caveats: Reports of issues if you put the machine to sleep while performing a back-up. I did this as a test and had trouble getting the back-up volume to un-mount. In the end I had to reboot the machine to release the lock on whatever file was causing the issue. Problems if trying to restore from Time Machine backup using System CD. Because you have to set a preference to get the machine to pick up unsupported devices like Windows Home Server shares, it is unclear if you can restore a whole machine from the System CD that doesn't have the preference set. Personally I have a few whole image backups that I have kept around that I could restore from an external disk so this hopefully won't be an issue for me - the Time Machine stuff is really just an incremental backup. However I still need to test the restore process
-
By default in Mac OS X browsing to Windows 2008 and 2003 Servers is extremely slow, navigating from one directory level to the next can take a minute or longer. I utilize my Mac to access the office Windows 2008 and 2003 file servers and the speed to access these shares makes it almost impossible to work from a Mac. To make things even worse I do most of my work through a Cisco SSL VPN loaded on my Mac from home over a broadband connection. Out of pure frustration I started playing with settings in my SMB configuration and have found a way in Mac OS 10.6.7 to speed the process up drastically to where navigating folders is almost instantaneous (including over my VPN). This makes the Mac work just as fast as my Windows 7 workstation when connecting to Windows servers. In order to fix the slow SMB browsing you will need to edit the smb.conf file on your Mac. The file is only editable by the user root so you'll need to use a text editor that can authenticate (like BBEdit or TextWrangler) or do this in the Terminal. I did the latter. I had root enabled and used the 'su' command, but you can just use 'sudo' with your administrator account to accomplish the same thing. Once the file has been edited and saved you will need to restart your mac for the changes to take effect. Mac OS X being Unix at the core utilizes the Samba daemon to access Windows networks and the smb.conf file controls how Samba accesses these Windows shares. 2br Launch the Terminal (Applications/Utilities/Terminal). You can use the vi or the pico editors included with Mac OS X to edit the smb.conf file by typing sudo vi /etc/smb.conf or sudo pico /etc/smb.conf. You will be prompted for a password, utilize the password for your admin account. I used vi. In order to change anything within the file you will need to put vi into insert mode by typing the letter i (at the bottom you will see the word insert). Some handy vi editor tips: vi has 2 modes: 'Command Mode' and 'Insert Mode.' To switch between modes you use the letter i in Command Mode to switch to Insert Mode and when in Insert Mode you use the Escape key to switch to Command Mode. File saves are done in Command Mode and edits to the file are done in Insert Mode. You can search the file you are editing in Command Mode by typing /searchstring where searchtring is what you are looking for in the file. Scroll down to the line use spnego = yes and change the yes to a no. Continue to scroll down to stream support = yes and change this to no, on the line immediately below that says ea support = yes change this to no. In the next group that says darwin_streams:brlm = yes change this to no. Save the file by first taking vi out of insert mode by pressing the Escape key. Then to save the file and quit vi type :wq and press Return. Restart your Mac. This simple fix for slow SMB browsing decreased the time to open shares and files on my Windows 2008 server from my Mac drastically.
-
1. So let’s begin creating a pseudo shell named /bin/ftpaccess debian:~# touch /bin/ftpaccess debian:~# echo 'echo "This accout is for ftp access only"' > /bin/ftpaccess debian:~# echo 'exit 0' >> /bin/ftpaccess debian:~# chmod +x /bin/ftpaccess 2. It’s also necessary to include the just created pseudo FTP shell/bin/ftpaccess in your /etc/shells file. echo '/bin/ftpaccess' >> /etc/shells 3. Then edit your /etc/passwd and change in the user shell, you should edit a line similar to: ftp-user:x:1011:1005:FTP User,,,:/home/ftp-user:/bin/bash Afterwards the same user /etc/passwd line declaration should look like: ftp-user:x:1011:1005:FTP user,,,:/home/ftp-user:/bin/ftpaccess Now the ftp-user user should have an FTP file transfer upload/download access to the server but it’s SSH, SCP and SFTP access will be disabled. Talking about disabling access of SFTP it’s worthy to mention the RSSH Project . RSS is quite cool and is able to restrict a shell access via SSH but same time allow users to use the SFTP and SCP protocols. Other user feedback/experience for accomplishing the same task is very welcome!
-
The first question that popped into my head after it was revealed that Lion would be a download only upgrade was "what if I need a boot disk?" I've had too many hard drives crash, and had to reinstall too many operating systems to do without a physical boot disk. Plus I've never been one to tote around an external bootable hard drive. Thankfully creating a Lion boot disk is quite painless. 1. Purchase and download Lion from the Mac App Store on any Lion compatible Mac running Snow Leopard. 2. Right click on “Mac OS X Lion†installer and choose the option to “Show Package Contents.†3. Inside the Contents folder that appears you will find a SharedSupport folder and inside the SharedSupport folder you will find the “InstallESD.dmg.†This is the boot disc image we have all been waiting for. 4. Copy “InstallESD.dmg†to another folder like the Desktop. 5. Launch Disk Utility and click the burn button. Select the copied “InstallESD.dmg†as the image to burn, insert a standard sized 4.7 GB DVD, and wait for your new Lion Boot Disc to come out toasty hot.
-
Nginx and Apache2 are running great but there is only one tiny problem with the visitors ip’s. Normaly I let my nginx instance do the logging job, but if you let your Apache do it you will get some problems. Apache will see all incoming requests as coming from localhost (127.0.0.1). Right they are all from nginx. Solution: # Install rpaf module for Apache2 aptitude install libapache2-mod-rpaf # Enable it a2enmod rpaf Now add this to your apache.conf or httpd.conf RPAFenable On RPAFsethostname On RPAFproxy_ips 127.0.0.1 10.0.0.1 RPAFheader X-Forwarded-For # Restart apache2 /etc/init.d/apache2 restart This tells Nginx to forward the original remote IP-address in the header as it proxys ro Apache. Add this 3 Lines to your nginx.conf or to your enables site config: proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
It seems like apple screwed up something in Lion DP4, causing GMA950 graphic adapters to show poor backlight light / dark screen. Replacing the AppleIntelIntegratedFramebuffer.kext in /s/l/e with the one from DP3 fixes the issue. I'v attached it to this blog post, use kext Helper to replace it and reboot.. Update 1) As mario pointed out, remember to repair permissions. //Leon FILE: AppleIntelIntegratedFramebuffer.kext_.zip
-
Sometimes it is very annoying to wait ten's of seconds to finish remote ssh server's reverse dns lookup procedure. It can be disabled on the server side but this process has a few tricks. First of all, you can make "UseDNS no" in /etc/ssh/sshd_config file, default answer is yes and if this line not shown in your config file, just add it to as below: UseDNS no This directive tells sshd process to check resolved host name for the connected client's ip address maps back to the very same ip address or not. After you have done the change, restart your SSH server with a: /etc/init.d/ssh restart NOTE: It does not prevent the sshd server from performing any DNS lookups at all. That's not the purpose of that directive. In order to remove dns lookups completely, you have to use -u0 options when starting sshd server. You can easily add this options to /etc/default/ssh or/etc/sysconfig/sshd or elsewhere suitable for your distribution. -u0 option's means that it will not put hostnames into the utmp structure (i.e. what you see when you type "who" at the shell prompt), which means that sshd will not perform DNS lookups for that purpose. However there are still cases where a lookup has to be performed when a user has "from=" like entries in his authorized_keys file, or when authentication methods or configuration directives are used that involve hostnames.
-
The other day i wanted to test LogMeIn Hamachi on a older G4 - to my big disappointment the damn thing is only supported on Intel macs.. and best of all.. you first get to know about it after installation. good work.. NOT.. Ever funnier, the uninstall app is also for Intel only.. WTF?!?!?! .. well ok.. after a great deal of research i put together a guide for howto uninstall the damn thing. 1. Remove the actual app from /Applications 2. Open terminal and type: sudo rm /usr/sbin/tuncfg sudo rm /usr/bin/hamachi sudo rm /usr/bin/hamachi-init rm -r /home//.hamachi Now remove any Hamachi/LogMeIn of the entries from: /System/Library/LaunchDaemons /Library/LaunchDaemons /System/Library/LaunchAgents /Library/LaunchAgents .. and finally remove: /System/Library/LaunchDaemons/tuncfgd.plist .. reboot.. Home this helps somebody out there...
-
UNIX includes a program named 'cron' to handle the execution of tasks on a specified schedule, regardless of whether the user is logged in or not. Cron does this through a series of simple text files known as 'crontabs' which control the scheduling of jobs. The cron daemon is used by the system for scheduled daily, weekly, and monthly maintenance, and can be used by users to run various programs at set intervals, such as to handle my site backup program as described elsewhere on this site. Read the rest of this article if you'd like a simple overview of what cron is and how it can be used. The system cron tasks are stored in /etc/crontab. You can "cat" this file to get an example of what a crontab looks like: user% cat /etc/crontab # $NetBSD: crontab,v 1.13 1997/10/26 13:36:31 lukem Exp $ # # /etc/crontab - root's crontab # SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin HOME=/var/log #min hour mday month wday user command */10 * * * * root /usr/libexec/atrun # do daily/weekly/monthly maintenance 15 3 * * * root sh /etc/daily... 30 4 * * 6 root sh /etc/weekly... 30 5 1 * * root sh /etc/monthly... [NOTE: There are TABS between the items, so don't copy/paste anything you see here; type it with tabs between fields!] If you want even more info on what the system is actually doing for maintenance, follow the path under the COMMAND column, and "cat" the actual .sh files ... there's quite a bit going on for which you might like to leave your system running at least overnight on occasion! The basic format of the file is relatively self-explanatory, sort of! An "*" in a column reads as "every", and the "*/10" in the first command line means "every 10th minute". So the weekly maintenance is set to run at 30 mins, 4 hours (or 4:30am) every day of every month, on the 6th day of the week. After the scheduling block is a column for which user the command will run as (root in this case), and what the acutal command is that will be executed. You can add new system-wide tasks to the cron program by inserting lines into this file (but you must be 'root' in order to do so). More applicable to a typical user would be to schedule their own cron task. I did just that for my backup solution mentioned in another hint. To do this, I first copied the root crontab to a file in my directory (cp /etc/crontab ~/mycrontab). I then edited the 'mycrontab' file to look like this (I've skipped the header, which I left the same as the root file): #min hour mday month wday command 25 2,14 * * * sh path/to/getmybackup.sh The 'sh getmybackup' runs my backup download shell script (see the related article on automated backups), and the time section is set to run it twice a day - at 2:25am, and 2:25pm (1425 in military time). Once the edited file has been saved, the final step is to tell the 'cron' program to schedule the task: crontab mycrontab That's all there is to it; the task is scheduled and will be executed twice a day at the specified time, as long as my machine is powered on. You can see a list of currently scheduled tasks by typing "crontab -l" at the command prompt, and you can cancel a crontab with "crontab -r". Hope this helped shed a little light on the dark world of cron...and as usual, there's much more to this subject than I've covered here, but this should be enough to get you started. Good way to edit your crontab on mac: EDITOR=nano crontab -e
-
Creds goes to Kevin Worthington I optimized and corrected a few links so here is a ready to use guide for installing nginx on OSX 10.6+ #!/bin/bash ## DOWNLOADS sudo curl -OL h http://ftp.exim.llorien.org/pcre/pcre-8.01.tar.gz > /usr/local/src/pcre-8.01.tar.gz sudo curl -OL h http://nginx.org/download/nginx-0.8.33.tar.gz > /usr/local/src/nginx-0.8.33.tar.gz ## Install PCRE sudo mkdir -p /usr/local/src cd /usr/local/src tar xvzf pcre-8.01.tar.gz cd pcre-8.01 ./configure --prefix=/usr/local make sudo make install cd .. ## Install Nginx tar xvzf nginx-0.8.33.tar.gz cd nginx-0.8.33 ./configure --prefix=/usr/local --with-http_ssl_module make sudo make install ## Start Nginx sudo nginx You may even paste this into eg. build.sh to make it even easier.. after installation you will find: nginx.conf -> /usr/local/conf stop nginx: killall nginx start nginx: /usr/local/sbin/nginx
-
This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. Requirements: Any modern Linux or OSX distribution Nearly any unix sistem with recent bash version, grep, ps We call ps (process list) command to list every system process and then use grep(filter) command to check if our process name is in that list, for example: $ ps ax | grep httpd 592 ?? Ss 8:22.25 /usr/local/apache/bin/httpd 3706 ?? I 0:58.06 /usr/local/apache/bin/httpd 3707 ?? I 0:40.12 /usr/local/apache/bin/httpd 3708 ?? I 0:49.56 /usr/local/apache/bin/httpd 3709 ?? I 1:02.86 /usr/local/apache/bin/httpd 3710 ?? I 1:12.26 /usr/local/apache/bin/httpd 3711 ?? I 1:20.03 /usr/local/apache/bin/httpd 3712 ?? I 0:48.79 /usr/local/apache/bin/httpd 3714 ?? I 1:01.60 /usr/local/apache/bin/httpd 3715 ?? I 0:58.91 /usr/local/apache/bin/httpd 3716 ?? I 0:42.88 /usr/local/apache/bin/httpd 28363 p3 S+ 0:00.01 grep httpd But if there is no such process, grep (filter) command will match itself, because command argument has exactly same string which is searched for: $ ps ax | grep nosuchprocess 28372 p3 S+ 0:00.01 grep nosuchprocess So, we have to add additional 'grep -v grep' filter that will remove process which command line contains 'grep' i.e. grep itself. Here is a script wich checks if SERVICE (variable at the beginning of script which contains service name) is running, and if it's not running, mails warning message to root: source code: bash script #!/bin/sh SERVICE='httpd' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE service running, everything is fine" else echo "$SERVICE is not running" echo "$SERVICE is not running!" | mail -s "$SERVICE down" root fi WARNING!!! If you process name is too short and is substring of some other process command line, suggested approach could fail (for example, you checking for 'testd' process, but have running 'testdoo-doo-doo" which will result false positive) Though, highly unlikely, but if your process name will begin with 'grep', suggested approach could fail
-
iCloud’s ‘Documents in the Cloud’ doesn’t let you do much except upload iWork files for use with iOS devices. To use those documents on another Mac, you have to download the file using the iCloud web interface. Poking around in the ~/Library folder, you can find a ‘Mobile Documents’ folder that is used for syncing iWork documents. But it turns out you are not limited to iWork files if you just want to sync between Macs (i.e. no iOS use). If you are using iCloud and have the ‘Documents & Data’ option selected in the preference pane, you can navigate to ~/Library/Mobile Documents. Depending on whether or not you’ve used iWork and synced documents to iCloud, you may or may not find folders there for each of the iWork applications (e.g. com~apple~numbers). This doesn’t really matter. What is of use is that any files put into the ~/Library/Mobile Documents folder will automatically upload to iCloud and push to any other Mac you have that is signed in to the same iCloud account and has the ‘Document & Data’ iCloud preference checked. Lion even notifies you of version conflicts and allows you to resolve them when you open the document. While its not entirely like with mobileme – its one step in the right direction Enjoy!
-
This tutorial will guide you through the setup of a fully-featured seedbox running on a Debian or Ubuntu system, including: libtorrent 0.13.0 rTorrent 0.9 ruTorrent Web UI (3.0) This guide has been tested with Debian 6 (x86_64) and Ubuntu 11.04 (x86_64). To start, access your VPS via SSH (as the root user) and do the following to update your platform and install some required dependencies: # apt-get update # apt-get install subversion build-essential automake libtool libcppunit-dev libcurl3-dev libsigc++-2.0-dev unzip unrar-free curl libncurses-dev # apt-get install apache2 php5 php5-cli php5-curl Enable scgi for Apache: # apt-get install libapache2-mod-scgi # ln -s /etc/apache2/mods-available/scgi.load /etc/apache2/mods-enabled/scgi.load Install XMLRPC: # mkdir /install;cd /install # svn checkout http://xmlrpc-c.svn.sourceforge.net/...mlrpc-c/stable xmlrpc-c # cd xmlrpc-c # ./configure --disable-cplusplus # make # make install Intall libtorrent: # cd /install # wget http://vps6.net/src/libtorrent-0.13.0.tar.gz # tar xvf libtorrent-0.13.0.tar.gz # cd libtorrent-0.13.0 # ./configure # make # make install Install rTorrent: # cd /install # wget http://vps6.net/src/rtorrent-0.9.0.tar.gz # cd rtorrent-0.9.0 # ./configure --with-xmlrpc-c # make # make install # ldconfig Create required directories: # mkdir /home/seeder1/rtorrent # mkdir /home/seeder1/rtorrent/.session # mkdir /home/seeder1/rtorrent/watch # mkdir /home/seeder1/rtorrent/download Setup .rtorrent.rc file (rTorrent config): # cd ~/ # wget http://vps6.net/src/.rtorrent.rc # cp .rtorrent.rc /home/seeder1/ (Edit the settings in .rtorrent.rc, like max upload/download speed, max connected peers, etc, as needed.) Install rTorrent: # cd /install # wget http://vps6.net/src/rutorrent-3.0.tar.gz # tar xvf rutorrent-3.0.tar.gz # mv rutorrent /var/www # wget http://vps6.net/src/plugins-3.0.tar.gz # tar xvf plugins-3.0.tar.gz # mv plugins /var/www/rutorrent # rm -rf /var/www/rutorrent/plugins/darkpal # chown -R www-data:www-data /var/www/rutorrent Secure /rutorrent: # a2enmod ssl # a2enmod auth_digest # a2enmod scgi # openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem # chmod 600 /etc/apache2/apache.pem # htdigest -c /etc/apache2/passwords seedbox seeder1 (Enter a password of your choice when prompted, you will use this to log in to the ruTorrent web UI.) # cd /etc/apache2/sites-available/ # rm -rf default # wget http://vps6.net/src/default # a2ensite default-ssl # /etc/init.d/apache2 reload Install screen: # apt-get install screen Start rTorrent in a detached shell using screen: # screen -fa -d -m rtorrent (To start rtorrent automatically when the VPS is booted, add the above command to /etc/rc.local) You can now access ruTorrent at http://xx.xx.xx.xx/rutorrent/ (replace xx.xx with your server's IP address). You should be greeted with a login prompt, where the username is "seeder1" and the password is the one you set above in the "secure /rutorrent" section. .. and there you go
-
Hi, This short guide will show you howto setup a VPN server in Debian with ONE network card. 1. Install the required packages apt-get install pptpd dnsmasq 2. Configure the IP range assigned to clients by running: pico /etc/pptpd.conf localip 10.0.0.1-99 remoteip 10.0.0.100-199,10.0.0.245 Using this config the clients are assigned any IP address between and including 10.0.0.100 and 10.0.0.199 3. Create a user allowed to connect by running: pico /etc/ppp/chap-secrets * * Passwords are not encrypted. This allows the a user with the username: user1 and the password: secretpassword to login from any ip address. 4. Enable IP forward at startup to allow the VPN clients to connect to the server's local network by running: pico /etc/sysctl.conf net.ipv4.ip_forward=1 Also run this command to activate the IP forward instantly: echo 1 > /proc/sys/net/ipv4/ip_forward 5. Create a routing rule to allow the VPN clients to route network traffic through the server. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 6. Add DNS configuration to your setup by running: pico /etc/ppp/options Change: ms-dns 10.0.0.1 ms-dns 8.8.8.8 7. Create a virtual network interface for 10.0.0.1 pico /etc/network/interfaces Add this: auto eth0:0 iface eth0:0 inet static address 10.0.0.1 netmask 255.255.255.0 Now.. reboot and enjoy VPN! Note(s): 1) On Ubuntu server, i had to create a "startup" script with the line below in order to enable data routing. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-
The best managers have a fundamentally different understanding of workplace, company, and team dynamics. See what they get right. A few years back, I interviewed some of the most successful CEOs in the world in order to discover their management secrets. I learned that the "best of the best" tend to share the following eight core beliefs. 1. Business is an ecosystem, not a battlefield. Average bosses see business as a conflict between companies, departments and groups. They build huge armies of "troops" to order about, demonize competitors as "enemies," and treat customers as "territory" to be conquered. Extraordinary bosses see business as a symbiosis where the most diverse firm is most likely to survive and thrive. They naturally create teams that adapt easily to new markets and can quickly form partnerships with other companies, customers ... and even competitors. 2. A company is a community, not a machine. Average bosses consider their company to be a machine with employees as cogs. They create rigid structures with rigid rules and then try to maintain control by "pulling levers" and "steering the ship." Extraordinary bosses see their company as a collection of individual hopes and dreams, all connected to a higher purpose. They inspire employees to dedicate themselves to the success of their peers and therefore to the community–and company–at large. 3. Management is service, not control. Average bosses want employees to do exactly what they're told. They're hyper-aware of anything that smacks of insubordination and create environments where individual initiative is squelched by the "wait and see what the boss says" mentality. Extraordinary bosses set a general direction and then commit themselves to obtaining the resources that their employees need to get the job done. They push decision making downward, allowing teams form their own rules and intervening only in emergencies. 4. My employees are my peers, not my children. Average bosses see employees as inferior, immature beings who simply can't be trusted if not overseen by a patriarchal management. Employees take their cues from this attitude, expend energy on looking busy and covering their behinds. Extraordinary bosses treat every employee as if he or she were the most important person in the firm. Excellence is expected everywhere, from the loading dock to the boardroom. As a result, employees at all levels take charge of their own destinies. 5. Motivation comes from vision, not from fear. Average bosses see fear--of getting fired, of ridicule, of loss of privilege--as a crucial way to motivate people. As a result, employees and managers alike become paralyzed and unable to make risky decisions. Extraordinary bosses inspire people to see a better future and how they'll be a part of it. As a result, employees work harder because they believe in the organization's goals, truly enjoy what they're doing and (of course) know they'll share in the rewards. 6. Change equals growth, not pain. Average bosses see change as both complicated and threatening, something to be endured only when a firm is in desperate shape. They subconsciously torpedo change ... until it's too late. Extraordinary bosses see change as an inevitable part of life. While they don't value change for its own sake, they know that success is only possible if employees and organization embrace new ideas and new ways of doing business. 7. Technology offers empowerment, not automation. Average bosses adhere to the old IT-centric view that technology is primarily a way to strengthen management control and increase predictability. They install centralized computer systems that dehumanize and antagonize employees. Extraordinary bosses see technology as a way to free human beings to be creative and to build better relationships. They adapt their back-office systems to the tools, like smartphones and tablets, that people actually want to use. 8. Work should be fun, not mere toil. Average bosses buy into the notion that work is, at best, a necessary evil. They fully expect employees to resent having to work, and therefore tend to subconsciously define themselves as oppressors and their employees as victims. Everyone then behaves accordingly. Extraordinary bosses see work as something that should be inherently enjoyable–and believe therefore that the most important job of manager is, as far as possible, to put people in jobs that can and will make them truly happy.