Skip to content

Instantly share code, notes, and snippets.

View dougsland's full-sized avatar
:octocat:
#opensource #upstream

Douglas Landgraf dougsland

:octocat:
#opensource #upstream
View GitHub Profile
[root@localhost ~]# journalctl -r | grep -i systemd
Mar 05 06:21:05 localhost.localdomain systemd[547]: Finished Cleanup of User's Temporary Files and Directories.
Mar 05 06:21:05 localhost.localdomain systemd[547]: Starting Cleanup of User's Temporary Files and Directories...
Mar 05 06:21:05 localhost.localdomain systemd[547]: Created slice User Background Tasks Slice.
Mar 05 06:16:20 localhost.localdomain systemd[1]: systemd-hostnamed.service: Deactivated successfully.
Mar 05 06:15:55 localhost.localdomain systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Mar 05 06:15:50 localhost.localdomain systemd[1]: Started Session 1 of User root.
Mar 05 06:15:50 localhost.localdomain systemd[1]: Started User Manager for UID 0.
Mar 05 06:15:50 localhost.localdomain systemd[547]: Startup finished in 282ms.
Mar 05 06:15:50 localhost.localdomain systemd[547]: Reached target Main User Target.
@dougsland
dougsland / README.md
Created October 16, 2023 13:37 — forked from engelmi/README.md
Basic bluechi-agent

Evil BlueChi-Agent

This gist shows a basic frame on how to implement a bluechi-agent for testing purposes only, e.g. as intended in containers/qm#234.

Using Python + DasBus

The python example does not include emitting signals as defined in the introspection data.

Running the example evil_bluechi_agent.py:

@dougsland
dougsland / gist:08c00779f1b27e359370ecfaf42c2a0d
Created September 7, 2023 14:42
BlueChi, dbus-devel and C
dnf install gcc dbus-devel -y
gcc -o list_nodes list_nodes.c -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include/ -ldbus-1
#include <dbus/dbus.h>
#include <stdio.h>
#include <stdlib.h>
void handle_structure(DBusMessageIter *structIter) {
int typeInStruct;
@dougsland
dougsland / gist:69b26df3bd729663cbb95cc24062d9e8
Last active September 7, 2023 14:36
BlueChi, dbus-devel library, C++ example
dnf install g++ dbus-devel -y
g++ -o list_nodes list_nodes.cpp -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include/ -ldbus-1
#include <dbus/dbus.h>
#include <iostream>
void handle_structure(DBusMessageIter *structIter) {
int typeInStruct;
while ((typeInStruct = dbus_message_iter_get_arg_type(
# Rust
Rust developers can take advance of **dbus-codegen-rust** to generate a Rust module
and use,tag,release in any pace it's appropriate to their project.
## Generating bluechi module
Make sure a BlueChi node is running and execute the below commands.
``` bash
# dnf install rust cargo
@dougsland
dougsland / gist:bbbf7fdc8ff338c91c33412888b1fc4b
Last active August 31, 2023 06:35
bluechi introspect org.eclipse.bluechi /org/eclipse/bluechi
# busctl introspect org.eclipse.bluechi /org/eclipse/bluechi
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.eclipse.bluechi.Manager interface - - -
.CreateMonitor method - o -
.DisableMetrics method - - -
.EnableMetrics method - - -
.GetNode method s o -
.ListNodes method - a(sos) -
.ListUnits method - a(sssssssouso) -
.Ping method s s -
@dougsland
dougsland / gist:7fcd2482470e3a93ba29e8d16ab8d0c6
Created May 25, 2023 15:35 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dougsland
dougsland / .bashrc
Created November 30, 2022 05:17 — forked from nf3/.bashrc
ssh-agent .bashrc script
# Note: not sure who wrote this, but thank you
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
@dougsland
dougsland / networkmanager-wifi-powersave.md
Created May 19, 2022 03:25 — forked from jcberthon/networkmanager-wifi-powersave.md
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@dougsland
dougsland / vagrant-cheat-sheet.md
Created February 27, 2022 13:37 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)