This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data":[ | |
{ | |
"header":{ | |
"handle":0, | |
"type":0, | |
"length":24 | |
}, | |
"description":"BIOS Information", | |
"values":{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"BIOS Information": { | |
"Vendor": "SeaBIOS", | |
"Version": "1.16.2-1.fc38", | |
"Release Date": "04/01/2014", | |
"Address": "0xE8000", | |
"Runtime Size": "96 kB", | |
"ROM Size": "64 kB", | |
"Characteristics:": [ | |
"BIOS characteristics not supported", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of using fcntl.flock for locking file. Some code inspired by filelock module. | |
""" | |
import os | |
import fcntl | |
import time | |
def acquire(lock_file): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of using sub-parser, sub-commands and sub-sub-commands :-) | |
""" | |
import argparse | |
def main(args): | |
""" | |
Just do something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "reseting config file..." | |
cp /etc/rhsm/rhsm.conf.default /etc/rhsm/rhsm.conf | |
echo "restarting rhsm.service..." | |
systemctl restart rhsm.service | |
# Set new variables using D-Bus API | |
echo "changing configuration..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton(object): | |
""" | |
Singleton and parent for singletons | |
""" | |
_instance = None | |
_initialized = False | |
def __new__(cls, *args, **kwargs): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMAKE_MINIMUM_REQUIRED (VERSION 3.11.2) | |
project(example C) | |
include(GNUInstallDirs) | |
set(CMAKE_C_STANDARD_REQUIRED ON) | |
set(CMAKE_C_STANDARD 11) | |
# Build type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import time | |
import copy | |
from multiprocessing import Process | |
from data import URLS | |
def send_request(num, url): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import dbus | |
import dbus.mainloop.glib | |
from gi.repository import GLib | |
import threading | |
import time | |
import socket | |
import ctypes | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <netdb.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
int | |
lookup_host (const char *host) |
NewerOlder