Skip to content

Instantly share code, notes, and snippets.

@gaurav36
gaurav36 / sshd_service_restart_example.py
Created September 6, 2020 21:59
sshd service restart example using python dbus API
import sys
import dbus
bus = dbus.SystemBus()
systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
manager = dbus.Interface(systemd, 'org.freedesktop.systemd1.Manager')
def restart(service):
"""
restart method will restart service that is passed in this method.
@gaurav36
gaurav36 / dbus_api.py
Created September 6, 2020 21:56
Using dbus API in python for managing services in Linux
import sys
import dbus
bus = dbus.SystemBus()
systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
manager = dbus.Interface(systemd, 'org.freedesktop.systemd1.Manager')
def disable_and_stop(service):
"""
disable_and_stop and stop method will check if the service is already running or not in system.
diff --git a/plugin/keyring/CMakeLists.txt b/plugin/keyring/CMakeLists.txt
index d098f27..dc24720 100644
--- a/plugin/keyring/CMakeLists.txt
+++ b/plugin/keyring/CMakeLists.txt
@@ -24,6 +24,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="keyring_file")
+set (CMAKE_CXX_FLAGS "-lcurl")
SET (KEYRING_FILE_SOURCES
@gaurav36
gaurav36 / own_key_gen.patch
Last active July 19, 2018 11:54
own key generation for keyring file plugin in mysql-server
diff --git a/plugin/keyring/CMakeLists.txt b/plugin/keyring/CMakeLists.txt
index d098f27..dc24720 100644
--- a/plugin/keyring/CMakeLists.txt
+++ b/plugin/keyring/CMakeLists.txt
@@ -24,6 +24,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="keyring_file")
+set (CMAKE_CXX_FLAGS "-lcurl")
SET (KEYRING_FILE_SOURCES