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/python3 | |
import gi | |
gi.require_version("Gtk","3.0") | |
from gi.repository import Gtk | |
icon = Gtk.StatusIcon.new_from_icon_name("gtk-yes") | |
Gtk.main() |
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
# create rootfs directory | |
set -ex | |
mkdir /rootfs | |
cd /rootfs | |
# download rootfs | |
repo="https://dl-cdn.alpinelinux.org/alpine/edge/releases/$(uname -m)/" | |
archive=$(wget -O - $repo | grep "minirootfs" | grep "tar.gz<" | sort -V | tail -n1 | cut -f 2 -d "\"") | |
wget -O alpine-rootfs.tar.gz $repo/$archive | |
# extract rootfs | |
tar -xf alpine-rootfs.tar.gz |
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 | |
set +e | |
f=$(mktemp) | |
red="\033[31;1m" | |
yellow="\033[33;1m" | |
reset="\033[;0m" | |
check_out_of_date(){ | |
link=$(curl https://archlinux.org/packages/?q=$1 | grep -v unstable | grep ">$1<" | grep "<td><a href=" | head -n1 | cut -f2 -d"\"") | |
if [[ $link == "" ]] ; then | |
return |
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
// valac --pkg gtk+-3.0 main.vala -o main | |
int main(string[] args){ | |
double constant_screen = 50.95481424; | |
Gtk.init(ref args); | |
var display = Gdk.Display.get_default(); | |
for (var i = 0; i < display.get_n_monitors (); i++){ | |
var monitor = display.get_monitor(i); | |
var width_milimeter = monitor.get_width_mm(); | |
var height_milimeter = monitor.get_height_mm(); | |
var width_pixel = monitor.get_geometry().width; |
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 | |
IFNAME="wlp3s0" | |
CON_NAME="Pardus-Wifi" | |
PASSWD="1234567891" | |
nmcli c add type wifi \ | |
ifname "${IFNAME}" \ | |
con-name ${CON_NAME} \ | |
autoconnect yes \ | |
ssid "${CON_NAME}" \ | |
802-11-wireless.mode ap \ |
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 | |
if ! which "$1" &> /dev/null ; then | |
exit 127 | |
fi | |
xhost +local: | |
mkdir -p "$HOME/.sandbox/home/$1" | |
exec env -i DISPLAY=$DISPLAY PULSE_SERVER=127.0.0.1 bwrap --bind / / \ | |
--dev /dev \ | |
--tmpfs /tmp --tmpfs /dev/shm \ | |
--bind /dev/dri /dev/dri \ |
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 python3 | |
from PyQt5.QtGui import QIcon, QFont | |
from PyQt5.QtCore import QDir, Qt, QUrl, QSize | |
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer | |
from PyQt5.QtMultimediaWidgets import QVideoWidget | |
from PyQt5.QtWidgets import (QApplication, QVBoxLayout, QWidget, QLabel) | |
# https://doc.qt.io/qtforpython-5/PySide2/QtMultimedia/QMediaPlayer.html | |
class VideoPlayer(QWidget): |
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
# docker build -t pardus:yirmibir . | |
FROM debian:bullseye | |
RUN apt update | |
RUN echo "deb http://depo.pardus.org.tr/pardus yirmibir main contrib non-free" > /etc/apt/sources.list | |
RUN apt update --allow-insecure-repositories | |
RUN apt install pardus-archive-keyring ca-certificates --allow-unauthenticated -y | |
RUN echo "deb http://depo.pardus.org.tr/pardus yirmibir main non-free contrib" > /etc/apt/sources.list | |
RUN echo "# deb-src http://depo.pardus.org.tr/pardus yirmibir main non-free contrib" >> /etc/apt/sources.list | |
RUN echo "" >> /etc/apt/sources.list | |
RUN echo "deb http://depo.pardus.org.tr/guvenlik yirmibir main non-free contrib" >> /etc/apt/sources.list |
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 | |
if [[ -e /sbin/init-normal ]] ; then | |
exit | |
fi | |
mv /sbin/init /sbin/init-normal | |
cat > /sbin/init <<EOF | |
#!/bin/bash | |
mount -t tmpfs tmpfs /tmp || true | |
mkdir -p /tmp/work/source /tmp/work/a /tmp/work/b /tmp/work/target || true | |
mount --bind / /tmp/work/source |
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 | |
if [[ $# -ne 2 ]] ; then | |
echo "Usage shc (source.sh) (output.c)" | |
exit 2 | |
fi | |
echo "#include <stdlib.h>" > "$2" | |
echo "int main(){" >> "$2" | |
echo " return system(\" \\" >> "$2" | |
cat $1 | sed 's/\\/\\\\/g;s/"/\\"/g;s/$/\\/g' >> "$2" | |
echo " \");" >> "$2" |