Skip to content

Instantly share code, notes, and snippets.

View scriptum's full-sized avatar

Pavel Roschin scriptum

View GitHub Profile
@scriptum
scriptum / getpid.c
Last active December 14, 2022 06:10
Getting PID of process by its command name in Linux-like OS.
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
/*
* This is example of getting PID of process by name. Returns first matched PID or -1.
* */
int getPidByName(const char *name)
{
@scriptum
scriptum / .bashrc
Created August 31, 2018 06:59
Prompt command
function __prompt_command_generator() {
PS1=""
local TXTRED='\[\e[0;31m\]' # red
local TXTGRN='\[\e[0;32m\]' # green
local TXTYLW='\[\e[0;33m\]' # yellow
local TXTBLU='\[\e[0;34m\]' # blue
local TXTPUR='\[\e[0;35m\]' # purple
local TXTCYN='\[\e[0;36m\]' # cyan
local TXTWHT='\[\e[0;37m\]' # white
@scriptum
scriptum / gtk.suppression
Created June 27, 2015 18:43
GTK valgrind suppresions
#
# Valgrind suppression file for Geany by RPG
#
# Format specification:
# http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress
#
#pango
{
import
intsets,
tables
type
GraphNode*[T] = ref GraphNodeObj[T]
GraphNodeObj[T] = object
val: T
adj: IntSet
nodesIn: int
(Audacity:8492): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager'
(Audacity:8492): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
(Audacity:8492): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
(Audacity:8492): Gnome-WARNING **: Accessibility: failed to find module 'libgail-gnome' which is needed to make this application accessible
(Audacity:8492): GLib-GObject-WARNING **: cannot register existing type 'GtkWidget'
dhcp-boot=pxelinux.0
dhcp-range=10.100.0.200,10.100.0.254,12h
dhcp-range=10.101.0.200,10.101.0.254,12h
dhcp-range=10.11.0.128,10.11.0.254
enable-tftp
tftp-root=/var/lib/tftpboot
<network>
<name>vlan-stacknet</name>
<uuid>b5e24f5d-0ec2-4fc1-9442-61bb1259402a</uuid>
<forward dev='enp5s0f1' mode='route'>
<interface dev='enp5s0f1'/>
</forward>
<bridge name='virbr2' stp='off' delay='0'/>
<mac address='52:54:00:e6:97:76'/>
<ip address='10.101.0.1' netmask='255.255.255.0'>
</ip>
NetworkManager-bluetooth-1.4.0-12.el7.x86_64
NetworkManager-1.4.0-12.el7.x86_64
NetworkManager-libnm-1.4.0-12.el7.x86_64
NetworkManager-team-1.4.0-12.el7.x86_64
NetworkManager-libreswan-gnome-1.2.4-1.el7.x86_64
NetworkManager-adsl-1.4.0-12.el7.x86_64
NetworkManager-wwan-1.4.0-12.el7.x86_64
NetworkManager-pptp-1.1.0-3.20150428git695d4f2.el7.x86_64
NetworkManager-tui-1.4.0-12.el7.x86_64
NetworkManager-pptp-gnome-1.1.0-3.20150428git695d4f2.el7.x86_64
#!/bin/sh
# Generated automatically from makewhatis.in by the
# configure script.
#
#!/bin/sh
# makewhatis: create the whatis database
# Created: Sun Jun 14 10:49:37 1992
# Revised: Sat Jan 8 14:12:37 1994 by faith@cs.unc.edu
# Revised: Sat Mar 23 17:56:18 1996 by micheal@actrix.gen.nz
# Copyright 1992, 1993, 1994 Rickard E. Faith (faith@cs.unc.edu)
configdirectory: /var/lib/imap
partition-default: /var/spool/imap
admins: cyrus
sievedir: /var/lib/imap/sieve
sendmail: /usr/sbin/sendmail
hashimapspool: true
sasl_pwcheck_method: saslauthd
sasl_mech_list: PLAIN LOGIN
allowplaintext: no
defaultdomain: my.domain