Skip to content

Instantly share code, notes, and snippets.

View isti115's full-sized avatar

István Donkó isti115

View GitHub Profile
@jdonofrio728
jdonofrio728 / wofi-emoji.sh
Last active March 8, 2022 19:06 — forked from NearHuscarl/rofi-emoji.sh
Wofi emoji picker
#!/usr/bin/env bash
# Source: https://gist.github.com/NearHuscarl/5d366e1a3b788814bcbea62c1f66241d
#
# Use wofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# wofi, wlroots based compositor
#
@jchv
jchv / recover-sway-socket.md
Last active May 3, 2024 01:43
How to recover your SwayWM socket in an SSH session.

How to recover your SwayWM socket in an SSH session.

I've run into a strange problem where sometimes, my monitors are forced to DPMS off and moving the cursor or pressing keys does not free it. I suspect this is a bug in my SwayWM configuration or a bug in Swaylock, but it resolves itself if I wait until the device again locks, which causes a second Swaylock instance to appear.

In any case, if you get yourself stuck and need to recover, you might want to be able to run swaymsg remotely. If you do, you might run into strange issues. swaymsg calls sway --get-socketpath to get the IPC socket, which... just returns the value of the SWAYSOCK environment variable. In my case, this also has the funny side-effect of starting a dbus session and SSH agent each time its invoked, because it is calling the NixOS-wrapped SwayWM binary. Probably should patch the NixOS version to explicitly call the unwrapped binary!

In order to recover the SWAYSOCK, one approach that should be relatively easy and does not requ

@SohamG
SohamG / fonts.conf
Last active March 13, 2024 13:09
Fix emoji in Linux and get color emoji in Discord! Place this fontconfig file in ~/.config/fontconfig/fonts.conf
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- REQUIRES Noto fonts (along with Noto Color Emoji)
run `fc-list | grep -i -e "noto sans" -e "noto serif" -e "noto color emoji"` to confirm
-->
<!-- Change the string in the family tag to whatever font -->
<family>serif</family>
<prefer><family>Noto Serif</family></prefer>
</alias>
@Therises
Therises / fix_mic_lenovo320.md
Last active February 27, 2024 15:46
Fix microphone on Lenovo IdeaPad 320 on Ubuntu 18.04

In /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf:

  • Under [Element Internal Mic Boost] set volume to zero.
  • Under [Element Int Mic Boost] set volume to zero.
  • Under [Element Mic Boost] set volume to zero

Find your source name from the following command; mine is alsa_input.pci-0000_00_1f.3.analog-stereo

  $ pacmd list-sources | grep 'name:.*input'

Edit /etc/pulse/default.pa and add the following lines, where INPUT_NAME is name of the input source from above step:

@fredokun
fredokun / gist:2c7a2d66035bb36f9f85
Created July 3, 2014 12:58
pdfjam command line for printing 2 pages per sheet in landscape mode
pdfjam --nup 2x1 --landscape input.pdf --outfile output.pdf
@cincodenada
cincodenada / logsb
Created November 2, 2013 01:39
A quick alias in irssi to save the scrollback log to a file. I recently turned on logging (/set autolog ON), and wanted to save what scrollback I'd kept as well. After some reading up, this should add the /logsb command, which stores logs for the current channel in the same place as the default logging, in files tagged .scrollback.log. The alias…
/alias logsb lastlog -file ~/irclogs/${tag}/${C}.${F}_${Z}.scrollback.log
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>