A few things, mostly technical notes...

Thursday, December 20, 2018

Python Script to Reboot TP-Link Cable Modem



TP-Link makes inexpensive yet nice Cable Modems, which can save you from those exorbitant Rental Fees charged by your predatory Cable Internet Provider.

We've been using a TP-LINK TC-7610 for a few months, here's a Python script we put together to reboot it.  You can easily use it to reboot your cable modem upon loosing your Cable internet.

reboot_tc7610.py


Let us know here if you have feedback or comments.


Thursday, March 22, 2018

create_zombie.c


Yep, it is time to spit out some C code.

create_zombie.c - when compiled this would create a zombie process.


$ ./create_zombie 
Parent at pid: 19240 and ppid: 20225
Our child 19241 will be the zombie, watch below:
S   PID COMMAND
Z 19241 [create_zombie] 



Below is the C code behind this:


/*
 * Author: evuraan
 *
 * when the child has exited, and the parent has not 
 * yet collected the child's death certificate, 
 * the child process becomes a zombie
 *
*/

#include 
char *cmd[300];

int main(){
 int pid;
 pid = vfork();
 if (pid == 0){
  /* child */
  exit(0);
 } else { 
  /* parent */
  printf("Parent at pid: %d and ppid: %d\n", getpid(), getppid() );
  printf("Our child %d will be the zombie, watch below:\n", pid);
  sprintf(&cmd, "%s %d", "ps  -o state,pid,command  -p ", pid);
  sleep(1);
  system(cmd);
 }

 return 0;
}
 
(Also available at : https://evuraan.info/evuraan/stuff/create_zombie.c.txt)

Followers


Creative Commons License
This work is licensed under a Creative Commons License.