Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
What is Bash?

Avinash H. Duduskar Strykar

💭
What is Bash?
  • India
View GitHub Profile
View makepkg.conf
#!/hint/bash
#
# /etc/makepkg.conf
#
#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
View autossh_systemd_unit.service
[Unit]
Description=AutoSSH service to remotely access signald's unix socket for weechat's signal.py (/smsg +145789323231)
After=network-online.target
# Use this instead if autossh will interact with the local SSH server
# After=network-online.target sshd.service
[Service]
Environment="AUTOSSH_GATETIME=30"
Environment="AUTOSSH_POLL=30"
Environment="AUTOSSH_FIRST_POLL=30"
@Strykar
Strykar / _README.md
Last active Jan 14, 2021 — forked from davejamesmiller/_README.md
Bash General-Purpose Yes/No Prompt Function ("ask")
View _README.md

This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default answer. It keeps repeating the question until it gets a valid answer.

View gist:377ba77479e974326cb19aa894c8ee79
root@apu:~# time awk 'BEGIN { OFMT = "%.0f"; for (i = 0; i < 50000; i++) print (95/100 * 42) }' > /dev/null
real 0m0.517s
user 0m0.435s
sys 0m0.081s
root@apu:~# time awk 'BEGIN { for (i = 0; i < 50000; i++) printf("%.0f\n", (95/100 * 42)) }' > /dev/null
real 0m0.862s
user 0m0.624s
sys 0m0.237s
@Strykar
Strykar / update_sqm.sh
Last active Dec 30, 2020
Update SQM limits in openwrt 4 times a day
View update_sqm.sh
#!/bin/sh
# v0.1 Avinash H. Duduskar <strykar@live.com>
# This adjusts OpenWRT SQM settings by re-calculating up/down bandwidth
# Needs the Speedtest.net CLI binary - https://www.speedtest.net/apps/cli
# Call this script every 4 or 6 hours via cron
_sqm_int="queue" # Your actual wan interface: ifstatus wan | grep -e l3_device
_pul="90" # Percentage of wan upload speed to set, 90-95 is good
_pdl="95" # Percentage of wan download speed to set, 90-95 is good
# User configurable variables end #
@Strykar
Strykar / owrt_ncurses-Makefile
Created Dec 17, 2020
Attempts at building Openwrt ncurses package with the tic and tput binaries to get htop to work with the kitty terminal
View owrt_ncurses-Makefile
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ncurses
View vulkaninfo.txt
==========
VULKANINFO
==========
Vulkan Instance Version: 1.2.153
Instance Extensions: count = 17
===============================
VK_EXT_acquire_xlib_display : extension revision 1
@Strykar
Strykar / failover.sh
Last active Dec 3, 2020 — forked from Apsu/failover.sh
An example failover script for dual WAN, using a ping healthcheck and managing default routes appropriately
View failover.sh
#!/bin/bash -x
# Test if sudo exists, comment out if sudo isn't installed
command -v sudo >/dev/null 2>&1 || { printf 'I require to be run as root, or sudo to be installed. Aborting. \n' >&2; exit 1; }
# Setting gateway's needs root privileges, elevate with sudo, tested on kernel 5.8.5-arch1-1.
# Comment out if script is called as root
if [ "$EUID" != 0 ]; then
sudo "${BASH_SOURCE[0]}" "$@"
exit $?
@Strykar
Strykar / Ucenter_Ublox-Linux
Created Jul 1, 2020
Connect to your Ublox GPS on a Linux machine from Ucenter on Windows.
View Ucenter_Ublox-Linux
socat -v /dev/cuaU0,ispeed=115200,ospeed=115200,echo=0,raw TCP4-LISTEN:1234,reuseaddr,nodelay
View rss_parser2.py
#!/usr/bin/env python
# coding=utf-8
#
# Python Script
#
# Copyleft © Manoel Vilela
#
#
from argparse import ArgumentParser
You can’t perform that action at this time.