Skip to content

Instantly share code, notes, and snippets.

@adnan360
adnan360 / install-weston-void-linux.md
Last active October 13, 2023 22:58
Basic Guide on how to install and use Weston (Wayland) on Void Linux (without SystemD)

How to Install and Use Weston (Wayland) on Void Linux (without SystemD)

sudo xbps-install weston
sudo usermod -a -G weston-launch `whoami`

Reboot to update the group assignment.

Now we can prepare the config. Let's create the file:

@adnan360
adnan360 / sway-on-void-linux.md
Last active March 5, 2024 05:33
Running Sway (Wayland) on Void Linux (without SystemD)

Running Sway on Void Linux (without SystemD)

elogind is the part of SystemD logind that can run as standalone. So we need it to run Sway without SystemD. To do that we need to build wlroots with elogind option. Then we can install and use Sway as normal from the current repo. There are other ways to achieve this without elogind here. But I tried with the elogind option and I was successful.

UPDATE: I tried again on a fresh install. The elogind option is set by default on the repo version. So you can skip the xbps-src command below and continue. wlroots should install as a dependency of sway if you follow the later commands.

git clone git://github.com/void-linux/void-packages.git
cd void-packages
./xbps-src binary-bootstrap
@adnan360
adnan360 / lamp-on-void-linux.md
Last active June 10, 2023 11:13
Instructions on how to install LAMP on Void Linux for easier PHP development

How to install LAMP in Void Linux

To install LAMP (Linux, Apache, MySQL/MariaDB, PHP) on Void Linux, follow these steps below.

NOTE: This has been prepared for ease of use in mind, not security. Please do not use these instructions to setup on a public server environment. Use other proper manuals instead.

Install the things we need:

@adnan360
adnan360 / restart-de.sh
Created May 14, 2019 15:53
Restart DE without reboot (good for fixing minor glitches, applying modified settings etc.) for Linux
#!/bin/bash
# Restarts the running DE without rebooting
# Save this file as a .sh file (e.g. restart-de.sh)
# run: chmod +x restart-de.sh
# then to restart DE: ./restart-de.sh
# Supports: LxQt, Openbox, KDE Plasma, GNOME, Mate, JWM, Budgie
xprop_session=$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') | grep _NET_WM_NAME | awk '{print $3}' | tr -d '"')
@adnan360
adnan360 / post-data.pas
Last active March 28, 2019 07:00
Send post data and show response
uses
..., fphttpclient;
procedure TForm1.Button1Click(Sender: TObject);
begin
With TFPHttpClient.Create(Nil) do
try
// Sends post request and puts the response in a TMemo.
// Data is passed as fieldname=fieldvalue format.
Memo1.Text := FormPost('http://localhost/test/post.php','test1=test2');
@adnan360
adnan360 / url-content-fphttpclient.pas
Last active March 13, 2019 10:17
Get URL Content in Lazarus - using TFPHttpClient
function FPHTTPClientDownload(URL: string; SaveToFile: boolean = false; Filename: string = ''): string;
begin
Result := '';
With TFPHttpClient.Create(Nil) do
try
try
if SaveToFile then begin
Get(URL, Filename);
Result := Filename;
end else begin
@adnan360
adnan360 / url-content-synapse.pas
Created March 12, 2019 12:35
Get URL Content in Lazarus - using Synapse
function DownloadHTTP(URL: string; SaveToFile: boolean=False; TargetFile: string=''): string;
var
HTTPGetResult: Boolean;
HTTPSender: THTTPSend;
S: string;
begin
// Result will be:
// - empty ('') when it has failed
// - filename when the file has been downloaded successfully
// - content when the content SaveToFile is set to False
@adnan360
adnan360 / fonts.conf
Created February 23, 2019 09:53
Fix to show Bangla text with a specific font within Monospace text in linux
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Config file to solve the problem that weird font shows when Bangla/Bengali
text appears within Monospace text. I had a debian install which was showing
Mitra Mono in place of Bengali text which was not great to look at. It will
show the Bengali text in SolaimanLipi font when Monospace text is shown.
@adnan360
adnan360 / save-and-close-confirmation.vim
Last active January 19, 2019 09:31
Ask if changes are unsaved and requests a filename to save it if the buffer was not saved anywhere (for VIM/NVIM). Convenient and neat!
" This code sets shortcuts for close buffer and save.
" They both work to let you know when a file has unsaved changes
" and offers you to give it a filename. We take this granted on
" modern text editors, but VIM does not have it by default.
" Tested in NeoVim, but should work with VIM as well.
" Put this on your ~/.vimrc for VIM and ~/.config/nvim/init.vim for
" neovim.
" Remaps 2 keyboard shortcuts
" Ctrl+W: for closing the buffer (and ask for confirmation, filename etc.)
" Ctrl+S: save (and ask for filename if not already saved
@adnan360
adnan360 / notification-sidebar.py
Last active July 20, 2020 04:39
A simple sidebar showing all the system notifications - based on xfce4-notifyd
# Written by Adnan Shameem
# License: CC0 - do whatever you want with it
# This script relies on xfce-notifyd. It is lightweight and saves the
# notifications in a ~/.cache/xfce4/notifyd/log file which is formatted
# in INI type format.
# To make this script work,
# 1. Install notification-daemon
# 2. Install xfce4-notifyd
# 3. Run either: