Skip to content

Instantly share code, notes, and snippets.

View uidops's full-sized avatar
☄️
_-_-_-_- ^ -_-_-_-_

joe uidops

☄️
_-_-_-_- ^ -_-_-_-_
View GitHub Profile
@uidops
uidops / whoami.c
Created March 11, 2021 11:52
Whoami (print effective userid) with C
/*
* Whoami - print effective userid
* Copyright (c) 2021 uidops.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@uidops
uidops / ntp.c
Last active March 18, 2021 06:49
Simple NTP Client with C
/*
* NTP Client.
* Copyright (c) 2021 uidops.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@uidops
uidops / bri.py
Last active April 19, 2021 13:33
Simple brightness control
#!/usr/bin/env python3
# coded by uidops
import sys
SYS_CLASS = "/sys/class/backlight/intel_backlight/brightness"
MAX_BRIGHTNESS = "/sys/class/backlight/intel_backlight/max_brightness"
def banner():
#!/bin/sh
while [ 1 ]; do
#fortune=`echo $(fortune -s) | sed "s/'//g"`
weather=`curl -s "https://wttr.in/qazvin?format=%C,+%t"`
if [[ "$weather" == *"Unknown"* ]]; then
weather="Unknow"
fi
time=`date +"%H:%M"`
date=`jdate +"%D"`
@uidops
uidops / utmp.c
Last active April 13, 2021 06:36
Simple utmp reader writen in c language
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / base64.c
Last active April 11, 2021 13:27
base64 encode and decode with openssl
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / sin.c
Last active December 25, 2022 17:14
Simple sine function
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / partitions.c
Created April 12, 2021 07:53
Show the partitions of a device block in c
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / daytime.c
Last active May 9, 2021 17:07
DAYTIME PROTOCOL IN C
/*
* BSD 2-Clause License
*
* Copyright (c) 2021, uidops
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
@uidops
uidops / Makefile
Last active May 15, 2021 13:47
TOR NEWNYM in c with notification sender (libnotify)
# BSD 2-Clause License
# Copyright (c) 2021, uidops
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.