Recent Notes

Displaying keyword search results 1 - 10
Created by voodoo on March 24, 2013 13:44:47    Last update: March 29, 2013 13:08:31
Use getpwnam group of functions. Example code: #include <sys/types.h> #include <pwd.h> #inc... For gid, use getgrnam
Created by magnum on November 03, 2012 08:57:35    Last update: November 03, 2012 08:57:35
Code snippet to check user name and password in C in Linux #include <sys/types.h> #include <pwd.h> #inc...
Created by magnum on October 22, 2012 19:48:03    Last update: October 22, 2012 19:48:03
execl takes the full path name of the command and variable length of arguments terminated by NULL: execl("/bin/ls", "/bin/ls", "-r", "-t", "-l", NULL... where the second argument is argv[0] , but can be any string! execlp will try to find the command from $PATH , so full path to command is not needed: execl("ls", "ls", "-r", "-t", "-l", NULL); execv is the equivalent of execl , except that the arguments are passed in as a NULL terminated array: char *args[] = {"/bin/ls", "-r", "-t", "-l", NULL ... execvp is the equivalent of execvl , excep that the arguments are passed in as a NULL terminated array: char *args[] = {"ls", "-r", "-t", "-l", NULL }; ...
Created by voodoo on August 03, 2012 08:42:38    Last update: August 03, 2012 09:31:25
The C function getsockopt lets you get the error codes with the option SO_ERROR . The possible error numbers are defined in the global errno.h . The relevant values are: #define ETIMEDOUT 110 /* Connection timed out */ ... But here's the whole list on my Linux system ( /usr/include/asm-generic/errno.h ): #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENER...
Created by voodoo on November 22, 2011 12:27:12    Last update: November 22, 2011 12:31:50
Unix hidden files are named starting with a dot ".". To find hidden files in the current directory: $ find . -type f -name '.*' or $ find . -type f | grep \\/\\. To find hidden files in the marketing directory: $ find marketing -type f -name '.*' or $ find marketing -type f | grep \\/\\.
Created by mee2 on November 20, 2011 21:00:58    Last update: November 20, 2011 21:10:22
Alfresco community-4.0.b has only 64-bit installer for Linux. These are the steps to manually install it on 32-bit Ubuntu Linux. Download alfresco-community-4.0.b.zip from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco . Install dependencies: $ sudo apt-get install imagemagick swftools postgr... Note: swftools was not available as a package for Ubuntu 11.10, I installed it with source . Create alfresco database: $ sudo bash [sudo] password for alfresco: ... Copy everything from the Alfresco web-server folder to Tomcat: $ cp -R alfresco-community-4.0.b/web-server/* apac... Edit $TOMCAT_HOME/conf/catalina.properties , change shared.loader to: shared.loader=${catalina.base}/shared/classes,${ca... Edit Tomcat conf file conf/server.xml , add URIEncoding="UTF-8" : <Connector port="8080" protocol="HTTP/1.1" ... Customize alfresco-global.properties : $ mv shared/classes/alfresco-global.properties.sam... Edit shared/classes/alfresco-global.properties : ############################### ## Common A... Copy keystore files from alfresco.war : expand alfresco.war , grab the whole keystore directory from...
Created by nogeek on November 16, 2011 20:47:33    Last update: November 16, 2011 20:47:33
VMWare Tools must be installed in the guest OS for shared folders to work. Configure the shared folder: Virtual Machine -> Virtual Machine Settings -> Options -> Shared Folders . Click the Add button to add a share. The share maps a host path to a name in the guest. If the guest system is Linux, the shared folder is available under /mnt/hgfs . If the guest system is Windows, the shared folder is available as \\.host\Shared Folders\<share_name>
Created by magnum on September 28, 2011 09:31:58    Last update: September 28, 2011 09:31:58
This procedure works for xl2tpd . Edit L2TP configuration file /etc/xl2tpd/xl2tpd.conf : ; ; This is a minimal sample xl2tpd configurati... Edit PPP options file for L2TP /etc/ppp/options.xl2tpd.client : ipcp-accept-local ipcp-accept-remote refuse-... Edit PPP authentication file /etc/ppp/chap-secrets : # Secrets for authentication using CHAP # serve... Start xl2tpd : # /etc/init.d/xl2tpd start Connect to the server: # echo "c vpnserver" >/var/run/xl2tpd/l2tp-control Tail /var/log/messages , you should see something like: Sep 28 11:05:46 sta101894 pppd[26059]: pppd 2.4.5 ... ifconfig should show that ppp0 is added: # ifconfig ppp0 ppp0 Link encap:Point-to-P... To tear down the vpn: # echo "d vpnserver" >/var/run/xl2tpd/l2tp-control If authentication fails, try to set "require authentication" to no on both server and client and restart xl2tpd on both sides: # /etc/init.d/xl2tpd restart # echo "c vpnserve......
Created by magnum on September 23, 2011 16:06:02    Last update: September 28, 2011 09:29:53
This procedure works for xl2tpd . Edit L2TP configuration file /etc/xl2tpd/xl2tpd.conf : ; Sample l2tpd.conf ; [global] ; listen... Edit PPP options file for L2TP /etc/ppp/options.xl2tpd : ipcp-accept-local ipcp-accept-remote ms-dns ... Edit PPP authentication file /etc/ppp/chap-secrets : # Secrets for authentication using CHAP # serve... Start the server: # /etc/init.d/xl2tpd start Monitor the log: # less /var/log/messages
Created by magnum on September 21, 2011 16:01:16    Last update: September 21, 2011 16:02:33
More like assign a second ip address to the same nic, instead of a virtual nic. Multiple IP addresses can be assigned to the same NIC, but all IP addresses must be on the same subnet - otherwise some IP addresses will not be accessible. From command line, assign IP address 192.168.0.2 to alias eth0:0 : sudo ifconfig eth0:0 192.168.0.2 netmask 255.255.2... But IP addresses added this way are not persistent. They are lost whent he OS is restarted. To make the additions persistent: For Fedora: $ su - # cd /etc/sysconfig/network-scripts/ ... The contents of ifcfg-eth0:0 should look like this: DEVICE=eth0:0 IPADDR=192.168.0.2 NETMASK=255... Restart network: # service network restart For Ubuntu: $ sudo vi /etc/network/interfaces Append this to the file: auto eth0:0 iface eth0:0 inet static name Et......
Previous  1 2 3 Next