Skip to content

Instantly share code, notes, and snippets.

Portage 2.3.40 (python 3.6.5-final-0, default/linux/amd64/17.0/no-multilib, gcc-6.4.0, glibc-2.26-r7, 4.17.3-gentoo x86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-4.17.3-gentoo-x86_64-AMD_Athlon-tm-_II_X3_455_Processor-with-gentoo-2.4.1
KiB Mem: 16140072 total, 9304936 free
KiB Swap: 0 total, 0 free
Timestamp of repository gentoo: Sat, 14 Jul 2018 20:24:29 +0000
Head commit of repository gentoo: f967c7c07e8811df780629d530b240bd9545bd68
#include <fcntl.h>
#include <kvm.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
@su8
su8 / freebsd2.c
Last active August 17, 2018 09:05
#include <fcntl.h>
#include <kvm.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
@su8
su8 / freebsd3.c
Last active September 1, 2018 18:57
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/sysctl.h>
int main(void) {
u_int val[3] = {0};
char buf[256] = {""};
size_t len = sizeof(val);
/*
*
* Conky, a system monitor, based on torsmo
*
* Any original torsmo code is licensed under the BSD license
*
* All code written since the fork of torsmo is licensed under the GPL
*
* Please see COPYING for details
*
@su8
su8 / core.cc
Created September 1, 2018 19:29
/*
*
* Conky, a system monitor, based on torsmo
*
* Any original torsmo code is licensed under the BSD license
*
* All code written since the fork of torsmo is licensed under the GPL
*
* Please see COPYING for details
*
/* */
#ifndef FREEBSD_H_
#define FREEBSD_H_
#include <fcntl.h>
#include <kvm.h>
#include <strings.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <fcntl.h>
#include <kvm.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
/*
09/03/2018
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 version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@su8
su8 / fbsd.c
Created September 5, 2018 11:12
/*
* Step 1 - Add the four needed libraries to include
*/
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/systm.h>
/*
* Step 2 - Handle the load/unload event