Original Apollo 11 Guidance Computer (AGC) source code posted on github.

The original ASM source code for the lunar command and landing modules has been posted on Github. This gives us an insight into how it all worked. I wonder if someone could compile this code and get it working or not. I guess it would require the same hardware as was used in the 1960`s. […]

Fixed the PHP date code.

I have fixed my PHP date code, major facepalm when I had a default date hardcoded in the PHP… Should be all good now.

Useful C tricks and code samples.

How to define a string and print it out with the printf() function. #include <stdio.h>   /* Defining a global string. */   #define hi "Hello Sire."   int main(void) { /* Printing out the string. */ printf("%s\n", hi);   return 0; } How to run the /bin/sh executable with some C code. #include <stdlib.h> […]

Examining a piece of Linux malware with Kali Linux tools.

I have recently downloaded an executable, this is a piece of Linux malware. I run a query with strings on this file and I find out that this file makes changes to various utility commands on a Linux system such as netstat, ps, top and /bin/sh. This would be all the hallmarks of a rootkit […]

A simple C code snippet that shows how to do a function call.

This simple C code snippet shows how to do a function call in C. This calls the hi() function and runs it in main(). Very simple but useful code. And this does not need to call any include files. As I am using the built-in write() function. int hi() { int i; i = 0; […]

C code that will open a file and print the contents to the terminal.

This code will print the contents of a file to the terminal. Feel free to use this in your own projects if you wish. #include <stdio.h>   #define MEM "/proc/meminfo"   int main (void) {   FILE *g; char Meminfo[40]; g = fopen(MEM, "r"); if(!g) { printf ("Sorry, I cannot" \ "open: %s.\n", MEM); } […]

Stealth Linux code that can run on a machine and open a port invisibly.

This code that I found: http://paste.scratchbook.ch/view/6f74b58f can run on a Linux machine and open a port invisibly. This allows access to a Linux server without the process showing in process manager and on a port scan of the machine. This might be controversial thing to post on a Linux focused website, but this might be […]

My sysinfo program updated with new code. Even better than before!

http://www.securitronlinux.com/files/sysinfo.kdevelop-1.0.tar.gz. This is the link to my newly updated sysinfo program. This has code added using the sysinfo struct. This means that the memory and uptime information that is output is actually readable now. This is what the output of the memory and uptime section looks like now. [email protected]:~/Documents/sysinfo.kdevelop-1.0$ ./sysinfo 2 Ram & swap information. […]

A nice sample of code that will render a spiral on your terminal screen. This could be useful indeed.

This code sample will render a spiral on your terminal when you compile and execute it. Very interesting indeed. #include <sstream> #include <iostream> #include <string> std::string rle = "32 [email protected] 1n16 [email protected] [email protected] 1n13 [email protected] [email protected] [email protected] 1n10 [email protected] [email protected] [email protected] 1n7 [email protected] [email protected] [email protected] " "1n6 [email protected] [email protected] [email protected] [email protected] 1n4 [email protected] [email protected] [email protected] […]

Very cool code that prints a tick sign in asterisks. This is awesome C++ code.

This code prints out a tick sign using asterisks. I tested this code on Fedora 19 and gcc 4.8 and it compiles without any problems. #include <iostream> #include <iomanip> using std::cout; int main() { cout<<std::setw(8)<<"*"<<"n"; cout<<std::setw(7)<<"*"<<"n"; cout<<std::setw(6)<<"*"<<"n"; cout<<"* *"<<"n"<<"* *"<<"n"<<"*"; cout<< "n"; return 0; } This is what you should get when you compile and […]

Useful code snippets and commands for Linux.

Ralph using a computer.

Alternatives to the ping and traceroute commands on a Linux system. There are many alternatives to the ping and traceroute commands on a Linux system. The mtr command is one of them. This command will trace the route the network packets are taking to the target IP address. bash 06:42:02 Mon Jul 22 [[email protected] $ […]

Wrapping the printf() statement onto multiple lines in C and some other useful samples.

This code sample shows how we are wrapping a printf() statement onto multiple lines using backslashes. #include “stdio.h” #define hello “Hello World.” int main(int argc, char* argv[]) { printf(“This is a very long sentence we are handing down\n”\ “Mr smith, do you have anything to say for yourself”\ “?”); printf(“%s\n”, hello); return 0; } This […]

Miscellaneous Perl programming information. How to use for loops and printing HTML properly.

Opening a folder and listing the contents, and not listing certain files. This is the Perl code I was using on my very old Tripod.com website. opendir(DNAME, “$folder”) || die “I cannot open the requested directory $folder \n $!”; @dirfiles2 = readdir (DNAME); @dirfiles2 = sort(@dirfiles2); foreach $x2 (@dirfiles2) { if ($x2 eq “.”) { […]

Useful old C code of mine. Might be useful for reference.

This is a nice little program I wrote ages ago. /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later […]

Miscellaneous programming tricks with C.

This is a very simple Hello World program in C. int main() { write(1, “Hello World\n”, 14); } Counting how long a text string is. #include #include #define MSG “Hello Doctor, let’s get back to the TARDIS!” int main() { int g; g = strlen(MSG); if (g < 1) { printf(“The string is not very […]

Linux kernel 3.3 released, including some Android code?

The Linux kernel 3.3 has been released and among other features that have been included, there is some code from Google Android included. This is an interesting development, this does not mean that you can run Angry Birds on a Debian or Linux Mint system, but this could lead to something cool in the future. […]

My PHP code for my Linux pages index.

This code is on my http://securitron.securitronlinux.com page. It shows a random image and a random webpage link. <?php $time = strftime(“%A %d %B %Y. %r – %Z”); srand(time(NULL)); $day = rand() % 6; $string = sprintf(“<font size=\”2pt\”><p>Welcome to my website.</p>\n”); $links = array(“BejArray” => array(“0” => “perl_code.php”, “1” => “psx_doom.php”, “2” => “cgi_code.php”, “3” => […]

Good Firefox 11.0 setup for safer web browsing.

Good Firefox 11.0 setup for safer web browsing. The Firefox web browser truly is a very good and safe browser for everyday use, but with the addition of some extensions, the browsing experience can be made even more secure. Firstly, the Noscript extension is the best and most useful extension for blocking web scripts that […]

Useful C++ snippet. A better way to read in a sentence with STDIN.

This is a very useful C++ code snippet for reading in a line of text into STDIN. Hopefully this will be useful to someone. #include <iostream> #include <string.h> #include <sstream>   using namespace std;   int goku(void) { cout << "Hello, Please enter your name.\n" << endl; return 1; }   int main(int argc, char […]