Software Development with Go: Cloud-Native Programming using Golang with Linux and Docker Nanik Tolaram instant download
Software Development with Go: Cloud-Native Programming using Golang with Linux and Docker Nanik Tolaram instant download
https://ebookmeta.com/product/software-development-with-go-cloud-
native-programming-using-golang-with-linux-and-docker-nanik-
tolaram/
https://ebookmeta.com/product/software-development-with-go-cloud-
native-programming-using-golang-with-linux-and-docker-1st-
edition-nanik-tolaram/
https://ebookmeta.com/product/network-programming-with-go-
language-essential-skills-for-programming-using-and-securing-
networks-with-open-source-google-golang-2nd-edition-jan-
newmarch-2/
https://ebookmeta.com/product/network-programming-with-go-
language-essential-skills-for-programming-using-and-securing-
networks-with-open-source-google-golang-2nd-edition-jan-newmarch/
https://ebookmeta.com/product/fit-for-a-duke-dangerous-
dukes-10-1st-edition-wendy-soliman/
Going Global Transnational Perspectives on
Globalization Language and Education 1st Edition Leslie
Seawright
https://ebookmeta.com/product/going-global-transnational-
perspectives-on-globalization-language-and-education-1st-edition-
leslie-seawright/
https://ebookmeta.com/product/php-and-mysql-174-web-development-
luke-welling/
https://ebookmeta.com/product/if-looks-could-kill-80-s-baby-
series-2-1st-edition-tamrin-banks/
https://ebookmeta.com/product/her-special-alpha-hot-seals-x-
ops-3-5-paige-tyler/
https://ebookmeta.com/product/ours-to-share-1st-edition-ar-taboo/
Brand Strategy in Three Steps: A Purpose-Driven
Approach to Branding 1st Edition Jay Mandel
https://ebookmeta.com/product/brand-strategy-in-three-steps-a-
purpose-driven-approach-to-branding-1st-edition-jay-mandel/
Software Development
with Go
Cloud-Native Programming
using Golang with Linux
and Docker
Nanik Tolaram
Software Development with Go: Cloud-Native Programming using Golang
with Linux and Docker
Nanik Tolaram
Sydney, NSW, Australia
Acknowledgments����������������������������������������������������������������������������xvii
Introduction���������������������������������������������������������������������������������������xix
v
Table of Contents
ELF Package�������������������������������������������������������������������������������������������������������22
High-Level ELF Format���������������������������������������������������������������������������������������������� 23
Dump Example���������������������������������������������������������������������������������������������������������� 24
/sys Filesystem���������������������������������������������������������������������������������������������������28
Reading AppArmor����������������������������������������������������������������������������������������������������� 29
Summary������������������������������������������������������������������������������������������������������������31
Summary������������������������������������������������������������������������������������������������������������48
vi
Table of Contents
Docker Proxy�������������������������������������������������������������������������������������������������������98
Container Attack Surface����������������������������������������������������������������������������������105
Summary����������������������������������������������������������������������������������������������������������106
gosec����������������������������������������������������������������������������������������������������������������122
Inside gosec������������������������������������������������������������������������������������������������������������ 123
Rules������������������������������������������������������������������������������������������������������������������������ 128
Summary����������������������������������������������������������������������������������������������������������130
vii
Table of Contents
Chapter 8: Scorecard������������������������������������������������������������������������131
Source Code������������������������������������������������������������������������������������������������������131
What Is Scorecard?�������������������������������������������������������������������������������������������131
Setting Up Scorecard����������������������������������������������������������������������������������������������� 133
Running Scorecard�������������������������������������������������������������������������������������������������� 137
High-Level Flow������������������������������������������������������������������������������������������������������� 139
GitHub���������������������������������������������������������������������������������������������������������������145
GitHub API���������������������������������������������������������������������������������������������������������������� 145
GitHub Explorer�������������������������������������������������������������������������������������������������������� 156
Summary����������������������������������������������������������������������������������������������������������159
UDP Networking������������������������������������������������������������������������������������������������168
UDP Client���������������������������������������������������������������������������������������������������������������� 169
UDP Server�������������������������������������������������������������������������������������������������������������� 172
Concurrent Servers�������������������������������������������������������������������������������������������������� 174
Load Testing������������������������������������������������������������������������������������������������������175
Summary����������������������������������������������������������������������������������������������������������179
viii
Table of Contents
DNS Server��������������������������������������������������������������������������������������������������������188
Running a DNS Server��������������������������������������������������������������������������������������������� 188
DNS Forwarder�������������������������������������������������������������������������������������������������������� 189
Pack and Unpack����������������������������������������������������������������������������������������������������� 193
Summary����������������������������������������������������������������������������������������������������������196
Using gopacket�������������������������������������������������������������������������������������������������205
pcap������������������������������������������������������������������������������������������������������������������������� 205
Networking Sniffer�������������������������������������������������������������������������������������������������� 206
Capturing With BPF�������������������������������������������������������������������������������������������������� 217
Summary����������������������������������������������������������������������������������������������������������222
Epoll Library������������������������������������������������������������������������������������������������������232
Summary����������������������������������������������������������������������������������������������������������235
ix
Table of Contents
Summary����������������������������������������������������������������������������������������������������������263
Summary����������������������������������������������������������������������������������������������������������290
x
Table of Contents
Summary����������������������������������������������������������������������������������������������������������306
Bubbletea����������������������������������������������������������������������������������������������������������313
Init��������������������������������������������������������������������������������������������������������������������������� 315
Update��������������������������������������������������������������������������������������������������������������������� 318
View������������������������������������������������������������������������������������������������������������������������� 319
Summary����������������������������������������������������������������������������������������������������������321
xi
Table of Contents
Index�������������������������������������������������������������������������������������������������377
xii
About the Author
Nanik Tolaram is a big proponent of open source software with over 20
years of industry experience. He has dabbled in different programming
languages like Java, JavaScript, C, and C++. He has developed different
products from the ground up while working in start-up companies. He is
a software engineer at heart, but he loves to write technical articles and
share his knowledge with others. He learned to program with Go during
the COVID-19 pandemic and hasn’t looked back.
xiii
About the Technical Reviewer
Fabio Claudio Ferracchiati is a senior consultant and a senior
analyst/developer using Microsoft technologies. He works for BluArancio
(www.bluarancio.com). He is a Microsoft Certified Solution Developer for
.NET, a Microsoft Certified Application Developer for .NET, a Microsoft
Certified Professional, and a prolific author and technical reviewer.
Over the past ten years, he’s written articles for Italian and international
magazines and coauthored more than ten books on a variety of
computer topics.
xv
Acknowledgments
Thanks to everyone on the Apress team who helped and guided me so
much. Special thanks to James Robinson-Prior who guided me through
the writing process and to Nirmal Selvaraj who made sure everything was
done correctly and things were on track.
Thanks to the technical reviewers for taking time from their busy
schedules to review my book and provide great feedback.
Finally, thanks to you, the reader, for spending time reading this book
and spreading the love of Go.
xvii
Another Random Scribd Document
with Unrelated Content
men whom Hogal was to engage, to bring up our party to |9| ten
people, so that we might be prepared to deal with any small band of
marauding dervishes. Hogal was to purchase camels from the
Ababdeh, who possessed, and probably still do, the best camels for
the description of journey we were undertaking. He was to take
them into the desert to test their powers of endurance, as, from the
route chosen, they might have to travel fifteen days without water.
He was also to purchase extra camels to carry water, so that if the
necessity arose, we could strike further west into the desert than
arranged for, and be able to keep away from the wells for thirty
days. We were to take with us only such articles as were essential
for the journey; food, arms and ammunition, three hundred dollars
in cash, and our presents of watches, silks, jewellery, pipes, and
ornaments for the sheikhs we met.
Hogal was to leave Derawi on or about the 20th March, and
bringing the camels through the desert on the west of the Nile, was
so to time his last stage as to reach Wadi Halfa at sunset on the
26th or 27th. The guides, my clerk, servant, and myself were to slip
over by boat, and our caravan was to strike off west at once. Our
departure was to be kept as secret as possible.
On my reaching Shellal after leaving Hogal at Derawi, I was
overtaken by an old friend, Mohammad Abdel Gader Gemmareeyeh,
who, having learned in confidence from Hogal the reason for his
purchasing the camels, hurried after me to warn me against
employing Gabou as guide, as he knew the man was not to be
trusted. He told me that Gabou was acting |10| as spy for friend and
foe, and was being paid by both, but this I did not then credit. I
laughed at the man’s expressed fears, and telling him that as Hogal
and I were to direct the caravan, and Gabou was to accompany us
as guide, I had no intention of abandoning a journey, at the end of
which a small fortune awaited me. I knew very well that not a single
person was to be trusted out of sight and hearing, but as there was
no reason why Gabou should not be kept within both, there was
equally no reason why I should have any fears. Besides this, I was
vain enough to believe that perhaps I might, as a result of my
journey, be able to hand to the military authorities a report of some
value, and the halo of romance, which still hung over everything
Soudanese, was in itself no little attraction.
I reached Wadi Halfa about March 23, and set to work quietly with
final arrangements. Hasseena had elected to accompany us, and this
on the suggestion of Hogal, his reasons being first, that being
accompanied by a woman, the peaceful intentions of our little
caravan would be evidenced; secondly, that Hasseena, when the
slave of her old master of the Alighat Arabs, had on a number of
occasions made the journey between El Obeid, Dongola, and
Derawi, and would be of great use to us in hareems in very much
the same way that a lady in civilized countries, having an entrée to a
salon, is occasionally able to further the interests of her male
relatives or friends; and in the East, all women have the entrée to
hareems.
The morning after my arrival at Wadi Halfa I |11| heard that forty
of Sheikh Saleh’s men, led by one of his slaves, Ismail, had already
arrived to take over the arms and ammunition. Gabou came to me
the same day, and suggested our abandoning the proposed
expedition, as he was afraid that the dervishes might hear of Saleh’s
men coming in, and send out bands to intercept the caravan on its
return, and we might fall into the hands of one of them. Believing
that Gabou was simply trying to induce me to add to his
remuneration for the extra risks, I told him I should hold him to his
agreement. A day or two later, seeing that I was determined to go
on, he suggested that we should, for safety, accompany Saleh’s
men, but this I objected to. The Kabbabish were fighting the
dervishes, and lost no opportunity of pouncing down upon any small
bands, and I had no particular wish to look for more adventures
than my expedition itself was likely to provide. There was also the
question of time; Sheikh Saleh’s baggage camels would only move at
the rate of about a mile an hour, while ours would cover two and a
half to three miles easily.
On March 24, I received a telegram from Hogal, then at Assouan,
announcing his arrival there with the camels, and his intention to
come on at once, so that he should have reached Wadi Halfa on the
28th or 29th of the month. Gabou now exhibited particular anxiety
that we should join Saleh’s party, and took upon himself to make an
arrangement with them. On my remonstrating with him, he said that
if the dervishes were on the road, they would certainly be met with
between Wadi Halfa and the Selima Wells, |12| or, maybe, at the
wells themselves, and this was the only part of our route where
there was any likelihood of our coming in contact with them, our
road, after Selima, being well to the west. “Now,” said he, “if Saleh’s
caravan goes off, and the dervishes on the road are not strong
enough to attack, they will allow the caravan to pass, but wait about
the roads either in the hope of getting reinforcements in time to
attack, or with the hope of attacking any smaller parties.” He
believed the dervishes might go on to the wells, and encamp there,
so that in either case we should fall into their clutches. It was
Gabou’s opinion that Sheikh Saleh’s caravan was strong enough to
annihilate the dervish bands, which he now said he had heard were
actually on the road. This decided me. I asked him why he had not
told me of this before. He had forgotten to do so!
The 28th, 29th, 30th, and 31st of the month passed, and still no
appearance of Hogal and the camels. Ismail was impatient to be off,
and Gabou suggested, that as my camels must be close at hand,
Hasseena, Elias, El Amin and I should start with Saleh’s caravan, he
following us as soon as our camels arrived. My camels being in good
condition, and unloaded, would, he said, overtake the caravan in a
few hours, and he was very anxious to test them for trotting speed
while overtaking us. We were joined at Wadi Halfa by about twenty
Arabs of different tribes, bringing our caravan up to sixty-four men
and about a hundred and sixty camels. Gabou gave us as guide for
Selima, a man named Hassan, also of the |13| Dar Hamads. Crossing
to the western bank of the Nile early on the morning of April 1,
1887, by ten o’clock we had loaded up and started on that journey
to the Soudan, which was to take me twelve long years to complete.
When we had been two days on the road, I began to feel a little
uneasy at the non-appearance of my camels; but thinking that
maybe Gabou had purposely delayed starting so as to give them a
stiff test in hard trotting, I comforted myself with this reflection,
though as day after day passed, my anxiety became very real. On
the night of April 7, we judged we must be close to Selima Wells,
and sent out scouts to reconnoitre; they reached the wells, and
returned saying that they could not find traces of any one having
been there for some time. Our caravan reached the wells between
nine and ten o’clock in the morning, and about midday, while we
were occupied in watering the camels and preparing food, we heard
a shot fired from the south-east, and shortly afterwards one of our
scouts came in saying that he had been sighted by a party of about
twenty men on camels; one of the men had fired at him at long
range, and the whole party had then hurried off to the south.
A hurried conference was held; it was the general opinion that this
party must be scouts of a larger one, and that they had gone off for
the purpose of apprising their main body. Ismail decided upon
pushing on at once. There was little time for me to consider what to
do; to return to Wadi Halfa was out of the question, as Ismail could
not spare any of his men as a |14| bodyguard; to wait at the wells
was not to be thought of, and the only other alternative was to go
on with the caravan. I told Elias to write out short notes for Hogal
and Gabou, which I had intended to leave at the wells; but as Ismail
pointed out, I should have to leave them conspicuously marked in
some way to attract attention, and, if the dervishes got to the wells
first, or if those we had seen returned with others, they would be
the first to get the notes, which would endanger our caravan, and
the little party I was so anxiously expecting. There was nothing for it
but to go on and hope for the best. If the worst came to the worst,
it meant only that my gum expedition was temporarily delayed, and
that I should, after reaching Sheikh Saleh, take my first opportunity
of getting north again.
Map showing Proposed Route and Route actually taken by Caravan
see better image
CHAPTER II
B E T R AY E D B Y G U I D E S
On, I believe, our sixth day out from Selima, we crossed a caravan
route running east and west, and, referring to my map, I had no
hesitation in telling Ismail that this must be the caravan route
between El Kab and El Agia, but on which part of the road we were I
could not imagine. I wanted to attempt travelling along this road,
but Hassan declared it led to El Kiyeh. That we must now be close to
Wadi el Kab, every one knew. A “council of war” was held, at which
it was decided to risk going on, as we must be travelling towards the
wells on the extreme edge of the wady. We were to try and pick up
the wells, water the camels, fill our skins, and then strike direct west
and encamp at night-time, not to remain near the wells. While we
were discussing the situation, some |23| men had been sent along
the road to try and discover anything in the way of marks or tracks
which would give an idea as to our exact position, and they reported
that there could be little doubt of this being El Kiyeh road, and that
El Kiyeh must be six days distant. This news decided us. Our water-
supply was out. A six days’ march over that desert under such
conditions meant perishing of thirst, and there was, again, the
uncertainty as to whether we should be, after all, on the road to El
Kiyeh or El Etroun.
One of the camels was ailing, so it was decided to kill it, and let
the men have a good meal of meat. Early the next day, I believe our
eighth or ninth day from Selima, an Alighat Arab was sent scouting
to the west; he never returned. We halted and waited for his return
as arranged, and lost the night’s travel in consequence. On the
following day, unmistakable landmarks were picked up, which proved
that we were but a few hours distant from the Wadi el Kab, and it
was believed we could reach the wells by sunset. Unloading the
camels, and leaving four men in charge of the baggage, we started
off for the wells, expecting to return the same night. We travelled
without incident until about two o’clock in the afternoon, when we
reached the broken ground skirting the wady proper. My guide, El
Amin, and two men, had been sent on ahead to reconnoitre. The
place is dotted with sand-dunes and hillocks from fifty to a hundred
feet high, and on nearing the first hillock, and when approximately
at “A,” we heard a shot fired. El Amin and his companions had then
reached the spot |24| marked “G” on the accompanying plan; we
believed the shot to be a signal that they had found water, and
pressed on until we reached “B,” when shot after shot was fired, the
bullets whistling over our heads. At this moment we saw Amin and
his companions hurrying back to us. Next came some broken volleys,
but all the shots were high. Up to now we had not seen our
assailants, but the smoke from the rifles now discovered their
whereabouts—the hillock marked “C.”
I was slightly ahead of the main body, with Hassan, the guide,
some yards away on my right. Being mounted on a large white
camel, well caparisoned, and wearing a bright silk Kofeyeh on my
head, I offered an excellent mark, and shot after shot whistled over
me. I was turning my camel round to hurry back to the main body,
when I saw Hassan fall to the ground. Calling to my clerk Elias, who
was nearest to him, to help him back on the camel, or make the
camel kneel to cover him, I tried to get mine to kneel so that I could
dismount, but the brute was startled and restive. Elias called out
that Hassan was “mayat khaalass” (stone dead). Our men were now
quickly dismounting and loading their rifles. Bullet after bullet and
volley after volley came, but no one was struck as yet except
Hassan. Making the camels kneel, as a precaution against their
bolting, we advanced in open order towards the hillock from whence
the shots came, I on the extreme left, Ismail in the centre, and Darb
es Safai on the right. Rounding the hillock “C,” we caught the first
glimpse of the enemy, about fifty strong, and then rapidly retiring.
|25| We fired a volley into them, on which they turned and replied,
and a pretty hot fusilade was kept up for some minutes, but the
firing was wild on both sides. I saw two of our men fall, and about
eight to ten of the dervishes. Picking up their dead or wounded, they
hurried off again, leaving two camels behind. Darb es Safai, who
was leading the right, and was now well in advance, was the first to
reach the camels, and discovered that they were loaded with filled
water-skins. Calling out, “Moyia lil atshan;* Allah kereem!” (“Water
for the thirsty; God is generous!”), he commenced to unfasten the
neck of one of the skins. A mad rush was made for the water; arms
were thrown down, and the men struggled around the camels for a
drink. I tried for a few seconds, when I reached them, to counsel
moderation, knowing the effect of a copious draught on the system
under the circumstances and condition they were in. Some of the
men had been three days without water, and the camel flesh they
had eaten had not improved matters.
* Moyia lil atshan.
(Water for the thirsty.)
While the struggle was still in progress, Hasseena, who with Elias
had followed us up, ran to me saying that the dervishes were
returning, and, looking in the direction of “E,” I saw about a hundred
and fifty men advancing at a rapid pace. I raised the alarm, and
Ismail gave the call to arms; but few heard his voice in the din.
Those few fired a few shots, but it was now too late; in a moment
the dervishes were upon us, friend and foe one struggling mass.
Above the noise could be heard the voice of the dervish leader
reminding |26| his men of some orders they had received, and to
“secure their men alive.” Even in that moment it flashed upon me
that we had been led into an ambush, else why the reference to “our
master’s orders” given by their leader? Elias, Hasseena, and I ran
towards “F” to take cover; it was no use my using my fowling-piece
on that struggling mass, as I should have struck friend and foe. Just
as we reached the base of the hillock, Elias was captured, and the
five or six dervishes who had pursued us occupied themselves with
examining the contents of the bag he was carrying—my three
hundred dollars, jewellery, etc. They gave a mere glance towards
me, and then moved off.
Pushing a few stones together, I laid out my cartridges, reloaded
my revolvers, and prepared to die fighting. Ismail, the leader of our
caravan, had by some means managed to get clear of the mass,
and, reaching my camel, mounted it and rode off, riding hard to the
right of “F.” Seeing Hasseena and me, he called to us to try and
secure camels and follow him up. Hasseena on this ran down the
hillock; I had not noticed her disappearance from the immediate
vicinity of the hillock, as I was too much occupied hurriedly making
my diminutive zareeba of stones. Glancing over the stones later, I
was astonished to see her walking at the head of the dervishes who
had secured Elias, they following in Indian file. Hasseena called out
that I was given quarter, and that I was to stand up unarmed. This I
refused to do, and as they kept advancing, I kept my gun pointed at
them from between the stones. Hasseena again called out, |27|
saying that they had orders not to hurt me, in evidence of which
they fired their rifles into the air, and then laid them on the sand.
By this time I could see that our men were bound, and grouped
together on the plain; I left my cover, descended the hillock, and
advanced to the dervishes, when I was saluted with yells and cries
of “El Kaffir, El Kaffir” (“the unbeliever”). One, maybe more fanatical
than the rest, after vituperating me, made a motion as if to strike at
my head with his sword. Looking him in the eyes, I asked, “Is this
the word of honour (meaning quarter) of your Prophet and master;
you liar, you son of a dog? strike, unclean thing!” While, as is only to
be expected, I was at that moment trembling with fear and
excitement, I had lived too long in the East to forget that a bold
front and fearless manner command respect, if not fear. My words
and manner had the desired effect, for one, turning to my would-be
assailant, asked, “What are you doing? Have you forgotten our
master’s orders?” This was the second time something had been
said about “orders.” I put a few questions to my captors, but they
declined to reply to them, saying that I could speak to the Emirs
Hamza and Farag, and they hurried me towards them. The Emir,
whom later I knew to be Farag, asked my name, and what I wanted
in his country; then, turning to his followers without waiting for a
reply, called out, “This is the Pasha our master Wad en Nejoumi sent
us to capture; thanks be to God we have taken him unhurt.” The
latter remark was |28| made as a reproof to the man who had
threatened to strike me, as the incident had been reported, and also
as a warning to the others.
Taking me apart from the others, he continued, “I see you are
thirsty;” and, calling up one of his men, told him to pour some water
over some hard dry bread, and, handing it to me, said smilingly, “Eat
—it is not good for you to drink.” I divined his meaning. Had our
men not made that mad rush for the water, we might have had a
very different tale to tell, and who knows if, had we won the day and
reached Sheikh Saleh, the history of the Soudan for the past twelve
years might not have read differently? Mine would have done so.
CHAPTER III
IN THE HANDS OF THE DERVISHES
I was handed over to two men, who were held responsible for my
well-being; Hasseena and Elias were placed together in the charge
of others, and we were ordered to seat ourselves a little distance
away. The dervishes had with them military tents which must have
been taken at Khartoum, and one was soon pitched. Here the Emirs
and principal men met to hold a conference and inquiry. Darb es
Safai and others were taken up one by one, and the question put to
them direct, “Where are the rifles and the cartridges?” for no case
had, of course, been brought on with us to the wells. They denied
any knowledge of them; then replied Farag, “We will find them for
you, and show you how they are used.” My turn came, and in reply
to the usual question, I said that I knew nothing at all about them;
questioned still further, I admitted that I had seen a number of
boxes, but I could not pretend to know what was inside of them.
Asked then as to where they were, I said I could not tell—in the
desert somewhere; they had been thrown away, as the camels,
being tired and |30| thirsty, could not carry them any longer. Still
interrogated, I replied that the guide who had brought us here was
the first killed in the firing, and that I did not think any one else of
our caravan could find their way back to the place where the boxes
were left.
At this, rapid glances were passed from one to the other. Asked if
I was sure he was killed, I could only reply that my clerk had told me
so, that I had seen him fall, and indicated the place. Farag sent off a
man in that direction after whispering some instructions to him, and
during the few minutes he was away perfect silence reigned in the
tent, with the exception of the click, click of the beads of the Sibha
(rosary). When he returned, he whispered his reply to Farag. Two of
the Alighat Arabs who had joined us at Wadi Halfa were next
brought up and questioned; they did not give direct replies; they
were taken aside, but not far enough away to prevent my
overhearing part of what went on, when, as a result of promises and
then threats, I gathered that they undertook to lead the dervishes to
the spot where the cases had been left in the desert. It is quite
certain, from the questions put by the dervishes, that they were
ignorant of the precise spot where the baggage had been left, and it
in a measure confirmed the death of Hassan; but I have always had
a suspicion that the man shammed death and got away, to present
himself later on to Nejoumi. He might easily have mingled with the
dervishes and not been seen by us.
The sun had now set; the conference ended, and orders were
given by Farag for all to march back by |31| the route we had come,
the Alighat Arabs, with Amin between them, leading. We marched
for only an hour or so, for our camels, being tired and not having
been watered, gave trouble. A halt was called for the night, and
what water the dervishes had was partly distributed. By sunrise the
next day we were on the march again, twenty-five men, well
mounted, having been sent on in advance with the guides. All
Saleh’s men, wounded and sound, were compelled to walk, the
dervishes and their wounded riding on camels.
In the afternoon we reached the spot where we had left the four
men in charge of the baggage, to find them with their hands bound
behind them. The advance party had reached them about ten o’clock
in the morning, and had doubtless found them asleep, as no shots
had been fired. The men were not to be blamed in any way, and it
really mattered but little whether they were asleep or awake when
taken, with the odds against them. I had, on starting for the wells,
left them the little water I had saved; had they not had this, they
could not have slept.
In the same way that Saleh’s men had forgotten everything in that
mad rush for the water, so did the dervishes break loose, forget all
about their prisoners, and rush on the pile of cases. The ground was
soon littered with rifles, packets of ammunition, sugar, clothing,
food, and the hundred and one articles to be found in a trading
caravan, for the cases and bales of the Arabs who had joined us at
Wadi Halfa contained only merchandise. My mind was soon made
up; running towards the other prisoners with my |32| hunting-knife, I
thought that at all events the thongs of a few might be cut, and
making for the camels and scattering in different directions, a few
might have got clear. It was a mad idea, but it was something.
Before any part of my half-formed plan could be put into execution,
the guards were down on us. I was taken to the Emir, Said Wad
Farag, but I excused myself, saying that, being a medical man, I had
gone to see if I could attend to any of the wounded. Complimenting
me on my thought for the others, he recommended me to think of
myself, appropriated the knife the guards had found in my hand, and
told me he would let me know when to use it, warning me at the
same time not to attempt to speak to any of the other prisoners.
When the excitement over the loot had cooled down a little, a
camel was killed in honour of the occasion, and my servant
Hasseena was ordered to prepare some of the dishes. I was invited
to eat with the Emirs. Our first dish was the raw liver of the camel,
covered with salt and shetta—a sort of red pepper. I had seen this
dish being eaten, but had never partaken of it myself before. I had
two reasons for eating it now: first, I was hungry and thirsty;
secondly, one of the first signs of fear is a disinclination, I might say
inability, to swallow food, and fear of my captors was the last thing I
intended to exhibit. After the meal, my clothes were taken from me,
as they looked upon them as the dress of a kaffir, and I was turned
out into the night-air with my singlet, drawers, and socks as my
complete wardrobe. My turban and Baghdad |33| Kofiyeh were also
taken, so that I was bareheaded into the bargain.
When the dervishes had finished their food, and before they lay
down for the night, the Emir Farag sent for all the loot to be
collected and brought before his tent, when it would later on be
distributed according to the rules of the Beit-el-Mal (Treasury). This
institution and its working will be described later. Only a part of the
loot was collected, for the men, knowing from experience the
extraordinary manner in which loot “shrank” in bulk and numbers
when placed in the hands of the Emirs to be distributed according to
rule, concealed in the sand or beneath their jibbehs, whatever could
be hidden there. The pipes and tobacco found in the baggage were
burned, as their use was prohibited by the Mahdi. Amongst my
things was found my letter-wallet, and this was handed to the Emirs,
who afterwards sent for me and demanded to know the contents of
the letters. I replied that they were only business documents,
receipts for goods, and such like, but that if the wallet was handed
to me, I would translate each document. Being satisfied with this
answer, Farag kept the wallet. Complaining of my clothing having
been taken, he allowed me to have my flannel shirt, and gave me a
piece of rag as head-dress. In this guise, I lay down in the sand to
doze and wake the whole night through, conscious yet unconscious,
with the incidents of the last eighteen days chasing each other
through my brain.
The camp was astir long before sunrise, and by sunrise we were
on the move east towards El Kab, |34| which we reached about three
o’clock in the afternoon. The “wells,” at the part we arrived at, are
upon ascending ground; but the name “well” in this instance is a
misnomer. They are shallow basins scooped out with the hands or
any rough implement, the water being found about three feet below
the surface, shrubs indicating where to scoop. The camels were
watered and left to graze on the scanty herbage. Another camel was
killed to celebrate the capture of the caravan, and again I was
invited to take food with the Emirs. I was asked only the most
commonplace questions, but I could not get any reply to those I put,
except that Abdel Rahman Wad en Nejoumi would tell me all I
wished to know. While still with the Emirs, Farag called up his
followers again, and after congratulating them upon the capture of
the “English Pasha” and the caravan (though the Emir knew very
well who I was, from old days at Korti), he harangued them on the
advisability of obeying to the letter the orders of the Mahdi
transmitted to the Khaleefa, and by the Khaleefa to him, winding up
his oration with threats of punishment and imprisonment to any of
the faithful who robbed the Beit-el-Mal by concealing any of the loot,
after which he ordered every one to be searched again. I had many
opportunities later of seeing evidences of what the Emirs most relied
upon, in regard to the handing over of any loot—an exhortation to
their followers, and an appeal to their religious scruples—or threats
of punishment and imprisonment. Both went together, and were
administered in the order I have given them, and there was seldom
an |35| occasion when a search did not follow the appeal to their
honesty, and when punishment did not follow the search for
concealed loot.
Wad Farag dismissed me for the night, but I had hardly lain down
when two dervishes stole up, and asked me to describe all the
baggage I had with me. I said that a list would be found in my
wallet, which, if they would bring to me, would allow of me giving
them the required information. One left me, for the purpose, I
imagine, of asking the Emir for the wallet, but returned shortly
saying that I should have to remember, and that the list I then gave
would be compared with the list in the wallet. There was no list in
the wallet, but there were one or two letters I wished to extract. I
have thought since that, had I exhibited less anxiety to get hold of
the wallet itself, I might have induced them to hand over these
letters under one pretext or another. I soon discovered from their
questions that the dervishes were spying one upon the other, for
they asked me directly what were the contents of the bag taken
from Elias my clerk. I told them three hundred dollars, gold and
silver jewellery, and some jewellery which my servant Hasseena had
asked Elias to carry for her. Hasseena was sent for to describe her
jewellery. The information evidently gave these men huge
satisfaction, and taking Hasseena with them, they sent her back with
cooking utensils, food and firewood, and ordered her to prepare
food for me. Having had my food with the Emirs but a little time
before, I was at a loss to understand the meaning of this, but
learned later on |36| that it was to prevent any one else approaching
her for information. Whether these two men were, as they said, in
charge of the Beit-el-Mal, or whether, having seen any of the money
or jewellery, they wanted to get their share of it, I cannot say, but,
in the light of subsequent events, I should be inclined to believe the
latter.
When the food was ready, I invited my guards to eat it. I was
hoping that a full meal, especially as their fatigue was very evident,
would induce them to sleep, and feigning drowsiness myself, moved
off a few yards, and scooped out a sand bed. I was prepared to risk
anything for liberty; we were in the neighbourhood of the wells, and
might travel for days without being out of reach of water. Explaining
my plans to Hasseena, I told her, under the pretence of collecting
firewood, to try and get up to Amin and Elias, cut their thongs with
the large knife we had had to cut up the meat sent us for food, and
tell them to creep towards a small tree which I had noticed during
daylight, and await me there. Some camels with their feet fastened
by ropes were grazing there, and I believed that we might get away
unobserved, and get some hours’ start. But the guards of the
prisoners were not asleep; they were very much awake, searching
the prisoners for any valuables, an operation which was carried out
by each relief of guards, so that the sun rose with us still in the
hands of the dervishes.
THE KHALEEFA’S EUNUCHS AT ATTENTION.