LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Implementation of file transferring by using sockets c on Linux.

Posted Yesterday at 09:10 PM by 915086731

Code for file sending.
Code:
#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
...
Member
Posted in Uncategorized
Views 18 Comments 0 915086731 is offline
Old

Banana Pi Cluster

Posted Yesterday 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 27 Comments 0 Pyplate is offline
Old

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...
Member
Posted in Uncategorized
Views 37 Comments 0 the dsc is offline
Old

Time::TAI::Simple

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
...
ttk
Member
Views 29 Comments 0 ttk is offline
Old

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...
Member
Posted in Uncategorized
Views 32 Comments 0 sridhar11 is offline

  



All times are GMT -5. The time now is 12:10 AM.

Main Menu
Advertisement

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