Monthly Archives: May 2014

PHP and CURL

1234567891011121314151617181920212223242526function browse($url, $postData = null) {     $fields = ”;     if(is_array($postData) && sizeof($postData) >= 1){         $fields = http_build_query($postData);     }     $ch = curl_init();     curl_setopt($ch, CURLOPT_URL, $url);     … Continue reading

Posted in php, Web Development | Leave a comment

Directory sharing between Linux and Windows

1. Sharing/serving a Linux directory to Windows $ sudo apt-get install samba $ sudo smbpasswd -a USERNAME $ mkdir /home/USERNAME/sharedfolder $ sudo vi /etc/samba/smb.conf [sharedfolder] path = /home/USERNAME/sharedfolder available = yes valid users = USERNAME read only = no browsable … Continue reading

Posted in Linux, Operating System, Windows 7 | Leave a comment

Choosing the default network card (NIC) that should access the Internet

In the presense of multiple network adapters, it is sometimes necessary to manually specify which one is the default used for internet routing, for example. To accomplish this, you have to manually add a “metric” to each interface. Windows will … Continue reading

Posted in Operating System, Windows 7 | Leave a comment

Getting the current filename using bash

123456789101112131415$ cat ./testfilename.sh #!/bin/bash fullfile=`basename $0` filename=$(basename "$fullfile") echo "filename:"$filename extension="${filename##*.}" echo "extension:"$extension justfilename="${filename%.*}" echo "justfilename:"$justfilename $ ./testfilename.sh filename:testfilename.sh extension:sh justfilename:testfilename

Posted in Linux, Operating System | Leave a comment