Skip to content

Instantly share code, notes, and snippets.

View alunux's full-sized avatar

La Ode Muhammad Fadlun Akbar alunux

  • Chiba, Japan
View GitHub Profile
from xmlrpc.server import SimpleXMLRPCServer
from shutil import disk_usage
from json import dumps
kilo_bytes = 1024
mega_bytes = 1024 * 1024
giga_bytes = 1024 * 1024 * 1024
def send_to_client():
(total, used, free) = disk_usage ("/")
from json import loads
from xmlrpc.client import ServerProxy
from os import system
from sys import argv
def ping_server(server_addr):
print("Checking the server status...")
status = system("ping -c 1 -w 5 " + server_addr + " > /dev/null 2>&1")
if status == 0:
return ("Up", server_addr)
import dnf
if __name__ == '__main__':
with dnf.Base() as base:
base.fill_sack()
q = base.sack.query()
i = q.installed()
pkg32 = pkgnoarch = pkg64 = 0
for pkg in i:
#!/bin/bash
ver=`uname -r`
if [[ $(whoami) != "root" ]]; then
echo "Must be root"
exit 1
fi
if [[ `rpm -q kernel-PAE-devel` ]]; then
headerbar {
min-height: 0;
padding-left: 2px;
padding-right: 2px;
padding-top: 1px;
padding-bottom: 1px;
}
headerbar entry,
headerbar spinbutton,
@alunux
alunux / dummy-web-server.py
Created August 25, 2016 02:33 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
.scrollbars-visible-always {
// blok kode berikut untuk pengaturan scrollbar pada editor //
/deep/::-webkit-scrollbar {
width: 0.6rem;
height: 0.6rem;
z-index: 99999;
display: none; // baris ini yang membuat scrollbar menjadi tersembunyi secara default
}
/deep/:hover::-webkit-scrollbar {
display: block; // baris ini yang membuat scrollbar terlihat saat cursor mengarah kepadanya
repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch --excludepkgs=kernel*,perf,perf-debuginfo,python-perf,python-perf-debuginfo
repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch --excludepkgs=kernel*,perf,perf-debuginfo,python-perf,python-perf-debuginfo
repo --install --name=alunux-kernel-lts --baseurl=https://copr-be.cloud.fedoraproject.org/results/alunux/kernel-lts/fedora-$releasever-$basearch/
repo --install --name=alunux-budgie-git --baseurl=https://copr-be.cloud.fedoraproject.org/results/alunux/budgie-desktop-git/fedora-$releasever-$basearch/
repo --name="RPMFusion Free" --mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch
repo --name="RPMFusion Free - Updates" --mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-$releasever&arch=$basearch
repo --name="RPMFusion Non-Free" --mirrorlist=http://
@alunux
alunux / is_wireless.c
Created April 23, 2017 03:18 — forked from edufelipe/is_wireless.c
C example code to list all network interfaces and check whether they are wireless or not. Linux only. Tested on Ubuntu 10.04 and 12.04, but should be compatible with pretty much everything out there.
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <ifaddrs.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/wireless.h>
headerbar {
min-height: 0;
padding-left: 2px;
padding-right: 2px;
padding-top: 1px;
padding-bottom: 1px;
}
headerbar entry,
headerbar spinbutton,