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; }#include <stdio.h> /* Defining a global string. */…

Read More

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…

Read More

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

https://github.com/john302/sysinfo. 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. homer@deusvult:~/Documents/sysinfo.kdevelop-1.0$ ./sysinfo…

Read More

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; }#include…

Read More

Useful code snippets and commands for Linux.

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…

Read More

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 *…

Read More

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…

Read More

My PHP code for my Linux pages index.

This code is on my https://securitronlinux.com/linux/ 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”,…

Read More

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…

Read More