Skip to content

Instantly share code, notes, and snippets.

View Pavel-Sayekat's full-sized avatar
💭
What's the weather?

Pavel Sayekat Pavel-Sayekat

💭
What's the weather?
  • Nowhere
  • Bangladesh
View GitHub Profile
@preshing
preshing / build_cross_gcc
Last active August 1, 2025 16:21
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@MartyMacGyver
MartyMacGyver / RPi_Kernel_building_cross_compiled.sh
Last active May 12, 2021 06:45
Building the kernel for the Raspberry Pi/Pi2/Pi3 using a cross-compiler
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
@xero
xero / irc.md
Last active October 8, 2025 16:36
irc cheat sheet
@Manuel-Kehl
Manuel-Kehl / .xinitrc
Created November 5, 2015 01:20
My .xinitrc
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# Start Gnome-related services
gsettings-data-convert &
xdg-user-dirs-gtk-update &
@bittner
bittner / toggle-sshd.sh
Last active March 5, 2021 20:08
How can I access my Ubuntu phone over ssh? (no `adb shell` required)
#!/bin/bash
# GNU GPL v3 license, (c) 2016 by Alexander Kinne, Peter Bittner
# http://askubuntu.com/questions/601910/ssh-ubuntu-touch/653595#653595
IP_ADDRESS=$(ip addr show primary | grep wlan | grep 'inet ' | sed -e 's/^\s*inet //' -e 's/ brd .*$//' -e 's#/.*##')
echo "Your IP address: $IP_ADDRESS (wlan)"
if [[ "$(android-gadget-service status ssh)" == "ssh enabled" ]]; then
sudo android-gadget-service disable ssh
else
@srli
srli / stt.py
Last active July 26, 2020 23:40
#!/usr/bin/env python
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
import os
import pyaudio
import wave
import audioop
from collections import deque
@pantuts
pantuts / gist:13623a7ba5e7e1c4ce44
Created March 29, 2016 12:38
i3 wm shutdown/reboot/logout mode
# Create Log out, Reboot, Poweroff bindings
mode "Exit (L)ogout, (R)eboot, (P)oweroff" {
bindsym $mod+r exec systemctl reboot
bindsym $mod+l exit
bindsym $mod+p exec systemctl poweroff
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
--- g2uj23us.iso.orig.hex 2016-04-27 17:22:51.793876085 +1000
+++ g2uj23us.iso.hex 2016-04-27 17:22:40.877685523 +1000
@@ -8554,8 +8554,8 @@
00021690 00 00 00 00 00 00 00 00 9f 1b 44 00 85 24 00 00 |..........D..$..|
000216a0 43 4f 4e 46 49 47 20 20 53 59 53 20 00 00 00 00 |CONFIG SYS ....|
000216b0 00 00 48 41 00 00 e8 6c 8f 3a 49 00 7b 00 00 00 |..HA...l.:I.{...|
-000216c0 41 55 54 4f 45 58 45 43 42 41 54 20 00 00 00 00 |AUTOEXECBAT ....|
-000216d0 00 00 88 38 00 00 e9 92 84 38 4a 00 3a 00 00 00 |...8.....8J.:...|
+000216c0 41 55 54 4f 45 58 45 43 42 41 54 20 00 00 cf 8a |AUTOEXECBAT ....|
+000216d0 9b 48 9b 48 00 00 cf 8a 9b 48 4a 00 0d 02 00 00 |.H.H.....HJ.....|
@rometsch
rometsch / i3autolock.md
Last active July 2, 2025 17:03
Configure lockscreen for i3 window manager.

The i3-wm does not come with a keybinding to lock the screen or a preconfigured auto lockscreen. This gist describes how to setup both using i3lock and xautolock. i3lock is a minimalistic lockscreen and xautolock monitors mouse and keyboard activities to automatically lock the screen after a certain time of beiing inactive.

First get the tools if neccessary. E.g. sudo apt install i3lock xautolock.

To setup the keybinding Ctrl+Alt+l (last one is a lowercase L) to lock the screen append the following lines to the i3 configuration file located at ~/.config/i3/config.

# keybinding to lock screen
@Semant1ka
Semant1ka / how_to_setup_hotspot.md
Last active August 24, 2025 03:41
How to set up WiFi hotspot and troubleshoot WiFi problems on Debian

There are a few decent tutorials on how to setup hotspot on Linux, which I will share below, but this tutorial will focus on adversities that you without doubt will face while setting up your AP.

For AP setup we will need:

  • Hostapd utility
  • Some dhcp utility
  • A bit of patience (that was for my case)

How do I know that my WiFi adapter supports AP mode?

In terminal type sudo iw list this command will show info about your wifi interfaces. Look for Supported interface entry, if AP is in it, that means your Wifi devices support hotspot mode.