LinuxAnswers - the LQ Linux tutorial section.
Go Back > Blogs
User Name



Implementation of file transferring by using sockets c on Linux.

Posted 08-01-2014 at 09:10 PM by 915086731

Code for file sending.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h> 
#include <pthread.h>

#define SOCKET_PORT "50000"
#define TRANSFER_SIZE 2048

unsigned long int count = 0;

void error(const
Posted in Uncategorized
Views 422 Comments 0 915086731 is offline

Banana Pi Cluster

Posted 08-01-2014 at 11:13 AM by Pyplate

A few days ago I launched a new site called Banoffee Pi Server. It's running on a cluster of four Banana Pi servers running Nginx. I built the site with Pyplate CMS, a Python CMS that I wrote myself.

I built the web site on one server, and I used rsync to connect to the other servers over ssh and synchronize them. Pyplate generates static pages when caching is enabled. On this site every page can be cached, so there's no need to synchronize the entire CMS and database, just the...
LQ Newbie
Posted in Uncategorized
Views 522 Comments 0 Pyplate is offline

Bash quickie] Get a "random" number (larger than zero, within a range) with "shuf" only

Posted 07-31-2014 at 01:16 AM by the dsc (linux-related notes)
Updated 07-31-2014 at 01:39 AM by the dsc (deweirdifying the wording)

It always annoys me when I see things like "cat file | grep pattern | sed ..." when just "sed" would suffice, but I was guilty of using seq only to shuf random numbers when shuf can do it by itself.

shuf -n 1 -i 0-999999999

(apparently the largest number you can get is $((9999**8)) (9999^8 in bash-math), larger than that it gets negative, for some reason )

You also don't need to do some fancy "echo -e" with several...
Posted in Uncategorized
Views 304 Comments 0 the dsc is offline


Posted 07-30-2014 at 10:09 PM by ttk (Unpopular Positions: One Geek's Take)

Two things: First, my wife tells me this blog's interface sucks, and she hates trying to read it. Apparently it's horrible for users who do not have an LQ account. I'm kicking the tires on some alternatives.

Second, I've uploaded Time::TAI::Simple to CPAN. It provides a high-resolution count of seconds elapsed since the beginning of the epoch, much like Time::HiRes, but un-"corrects" for the IETF's leapsecond adjustments.

This means:
  • The number it returns
Views 312 Comments 0 ttk is online now

Step By Step Ubuntu 14.04 LTS (Trusty Tahr) LAMP Server Setup

Posted 07-30-2014 at 05:17 AM by sridhar11

In around 15 minutes, the time it takes to install Ubuntu Server Edition, you can have a LAMP (Linux, Apache, MySQL and PHP) server up and ready to go. This feature, exclusive to Ubuntu Server Edition, is available at the time of installation.The LAMP option means you don’t have to install and integrate each of the four separate LAMP components, a process which can take hours and requires someone who is skilled in the installation and configuration of the individual applications. Instead, you get...
Posted in Uncategorized
Views 275 Comments 0 sridhar11 is offline


All times are GMT -5. The time now is 11:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration