Skip to content

Instantly share code, notes, and snippets.

View scriptum's full-sized avatar

Pavel Roschin scriptum

View GitHub Profile
@scriptum
scriptum / Makefile
Created September 9, 2013 13:24
Simplest universal Makefile for *.c single file apps
CFLAGS += -O2 -pipe -Wall -Wextra
LDFLAGS += -lm
HEADERS = $(wildcard *.h)
SOURCES = $(wildcard *.c)
TARGETS := $(SOURCES:.c=)
all: $(TARGETS)
@scriptum
scriptum / tumbler.rc
Created March 4, 2017 07:12
/etc/xdg/tumbler/tumbler.rc
###
# [TypeNameOfPlugin]
# Disabled: Set to true to avoid loading the plugin. By default all
# plugins are loaded.
# Priority: Priority of the plugin if more plugins support the same
# uri-scheme / mime-type combination.
# Locations: ;-separated path list the plugin will be used in. If the
# source file is not a child of one of the locations, the
# plugin won't be used and another plugin with a lower
# priority will be tried.
public class ScreenSaverApp : Gtk.Application {
private Gtk.CssProvider provider;
private Gee.ArrayList<string> files;
private const string images_dir = "/usr/share/mga/screensaver/";
private int files_max = 0;
private int files_current = 0;
private const string css_tmpl = """
* {
transition-property: background-color, background-image;
# bc with trigonometry and useful functions
bc() {
/usr/bin/bc -qli <(echo '
scale=32
pi=4*a(1)
e=e(1)
scale=20
define sin(x) {
return (s(x))
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style type="text/css">
* {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
#
# Copyright (c) 2012 Mellanox Technologies. All rights reserved.
#
# This Software is licensed under one of the following licenses:
#
# 1) under the terms of the "Common Public License 1.0" a copy of which is
# available from the Open Source Initiative, see
# http://www.opensource.org/licenses/cpl.php.
#
# 2) under the terms of the "The BSD License" a copy of which is
# rpm -q --scripts ofed-scripts
postinstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then #This package is being installed or reinstalled
if [ -e /etc/yum.conf ]; then
list="ibutils-libs"
lista=`echo ${list} | sed -e "s/ /* /g" -e "s/$/*/"`
if [ -n "$list" ]; then
if ( grep -q "^exclude=" /etc/yum.conf ); then
new_list=
HTTP/1.1 200 OK
Connection: close
Date: Thu, 08 Dec 2016 16:48:51 GMT
Cache-Control: no-cache
Server: Cyrus/2.5.10-Fedora-RPM-2.5.10-1z6.el7 Cyrus-SASL/2.1.26 OpenSSL/1.0.1e Zlib/1.2.7 LibXML2.9.1 SQLite/3.7.17 Libical/1.0 Jansson/2.4
DAV: 1, 2, 3, access-control
DAV: calendar-access, calendar-availability, calendar-auto-schedule
Allow: OPTIONS, GET, HEAD, PUT, DELETE
Allow: PROPFIND, REPORT, COPY, MOVE, LOCK, UNLOCK
Content-Length: 0
> OPTIONS /dav/calendars/user/ova/Default/ HTTP/1.1
> Soup-Debug-Timestamp: 1481186108
> Soup-Debug: SoupSessionSync 1 (0x3d3c150), SoupMessage 1 (0x7f8aa80290e0), SoupSocket 1 (0x7f8ac401d410)
> Host: ldc01.oca.nci:8008
> User-Agent: Evolution/3.20.6
> Connection: close
> Accept-Language: ru-ru, ru;q=0.9
< HTTP/1.1 200 OK
< Soup-Debug-Timestamp: 1481186108
#!/bin/bash
# Пример меню в Bash
# включить отладку
DEBUG=1
# Текст запроса
PS3='Введите номер пукнта меню (q - выход): '
# Перечень пунктов меню
OPTIONS=(
"Добавить пользователя"