Skip to content

Instantly share code, notes, and snippets.

@sadesyllas
sadesyllas / Fedora35Hibernation.md
Created September 11, 2024 08:37 — forked from eloylp/Fedora35Hibernation.md
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
# https://xai.sh/2023/01/04/Signal-desktop.html
1. git clone https://github.com/signalapp/Signal-Desktop && cd Signal-Desktop
2. Checkout the release you want to build, e.g., git checkout v6.1.0
3. Edit package.json and add --linux AppImage to the end of the build:electron target
4. Run git lfs install
5. Make sure you have the correct nodejs version (requires nvm to be installed): nvm use
6. Make sure you have yarn: npm install --global yarn
7. yarn install --frozen-lockfile
8. yarn generate
9. yarn build
@sadesyllas
sadesyllas / build-signal-desktop-on-linux.sh
Created June 10, 2021 10:20
Build Signal-Desktop on Linux
#!/bin/bash
sudo dnf groupinstall @development-tools @development-libraries
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.38.0/install.sh | bash
# git lfs is needed, eg, for better-sqlite3 / without it, the downloaded `.tar.gz` file is not handled correctly
# (https://github.com/signalapp/Signal-Desktop/issues/5220)
sudo dnf install git-lfs
@sadesyllas
sadesyllas / hostapd.conf
Last active September 24, 2020 11:24
WiFi Hotspot
# /etc/hostapd/hostapd.conf
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
interface=<VIRTUAL_INTERFACE_NAME>
driver=nl80211
hw_mode=g
channel=8
ssid=<SSID>
wme_enabled=1
@sadesyllas
sadesyllas / wpa_supplicant.conf
Created September 8, 2020 13:37
Raspberry PI OS Wifi Configuration on boot
# This must be placed in the root directory of the boot partition
country=GR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}
@sadesyllas
sadesyllas / gawk_http_200_server
Created June 12, 2018 23:28
gawk http server that always returns 200
gawk 'BEGIN { s = "/inet/tcp/8844/0/0"; while (1) { RS = ORS = "\r\n"; r = ""; print "HTTP/1.1 200 OK" ORS "Content-Length: 0" ORS |& s; while ((s |& getline) > 0) { r = r $0 "\n" } close(s); gsub(/\s+$/, "", r); ORS = ""; print r "\n\n" } }'
@sadesyllas
sadesyllas / kodi.service
Created February 9, 2018 16:32
Kodi systemd service file
[Unit]
Description = Kodi
After = systemd-user-sessions.service network.target sound.target mysql.service
Wants = mysql.service
[Service]
User = kodi
Group = kodi
Type = simple
@sadesyllas
sadesyllas / README.txt
Created February 6, 2018 01:28 — forked from Cyberek/README.txt
Starting Kodi automatically on Raspbian Jessie and Stretch
So you were able to install Kodi via '''sudo apt-get install kodi''' but have no idea how to force it to autostart on boot?
You have tried all those googled solutions such as adding kodi-standalone to .bashrc, creating init.d script but nothing worked?
This is the right place to get the answer.
For some reason, the current version of Kodi doesnt provide 2 important files:
/etc/init.d/kodi
/etc/defaults/kodi
They are required to start kodi on boot. Also, for some unknown reason, I haven't found a single place in the whole internet, where those files would be available.
Now, to fix the problem you need to create /etc/init.d/kodi first:
sudo vim /etc/init.d/kodi (or sudo nano /etc/init.d/kodi if you are not a hardcore unix user)
The content for this file is provided in etc_init.d_kodi file attached to this gist
@sadesyllas
sadesyllas / Count Code lines
Created January 22, 2018 13:34 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@sadesyllas
sadesyllas / gist:b5a912d448c28c734d14a79744028763
Created January 18, 2018 14:48 — forked from mattd/gist:1006398
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;