Skip to content

Instantly share code, notes, and snippets.

View AnwarShah's full-sized avatar

Anwar AnwarShah

View GitHub Profile
@AnwarShah
AnwarShah / gsm-setup.md
Created May 16, 2017 15:46 — forked from heyalexej/gsm-setup.md
SIM Card Management Through GSM Modem On Linux

SIM Card Management Over GSM Modem

A small guide on how to send and receive USSD codes on Linux

I am using the built in GSM (UMTS) modem of my Thinkpad X1 extensively because I am often in places with flaky internet connections. I connect through the standard Network Manager on Ubuntu and everything works fine. There was one major annoyance though. Every time I wanted to top up the SIM balance or book a new package, I needed a phone to send and receive USSD codes. So I took some time to figure out how to do it from the shell. I wrote this down as a help for others and a reminder for myself. Without further ado...

First intsall gammu and picocom.

~  sudo apt-get install -y gammu picocom
@AnwarShah
AnwarShah / sublime-text-3.desktop
Created December 12, 2015 14:23 — forked from thebinarypenguin/sublime-text-2.desktop
A desktop application launcher for Sublime Text 3
[Desktop Entry]
Type=Application
Terminal=false
StartupNotify=true
Name=Sublime Text 3
Name[en_US]=Sublime Text 3
GenericName=Text Editor
GenericName[en_US]=Text Editor
Comment=Edit text files
Comment[en_US]=Edit text files
@AnwarShah
AnwarShah / gresource-extract
Created September 23, 2016 10:09
Gresource-extract. Original Credit goes to the author here http://projects.thecodergeek.com/scripts/gresource-extract
#!/bin/bash
##############################################################################
# Author: Peter Gordon <peter@thecodergeek.com>
# License: Public Domain
##############################################################################
# gresource-extract.sh
# Version: 1
#
# This Bash script is designed to extract all resource files in a given
# GResource file, with the given base folder. For example, if a GResource file
@AnwarShah
AnwarShah / favoriate-gnome-shell-extensions
Last active February 28, 2020 13:31
My favorite gnome shell extensions
Clipboard indicator - https://extensions.gnome.org/extension/779/clipboard-indicator/
CustomCorner - https://extensions.gnome.org/extension/1037/customcorner/
Dash to Dock - https://extensions.gnome.org/extension/307/dash-to-dock/
Dash to Panel - https://extensions.gnome.org/extension/1160/dash-to-panel/
Do Not Disturb Button - https://extensions.gnome.org/extension/964/do-not-disturb-button/
Extensions - https://extensions.gnome.org/extension/1036/extensions/
gistnotes - https://extensions.gnome.org/extension/917/gistnotes/
Hide Top Bar - https://extensions.gnome.org/extension/545/hide-top-bar/
Gnome-Prefs Button - https://extensions.gnome.org/extension/1054/gnome-prefs-button/
Impatience - https://extensions.gnome.org/extension/277/impatience/
@AnwarShah
AnwarShah / ffmpeg.md
Created July 20, 2019 11:26 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@AnwarShah
AnwarShah / theme_looper.rb
Created September 15, 2018 18:19
Change GTK theme once per minute
#!/usr/bin/ruby
themes_dir = Dir["/usr/share/themes/*"].select do |entry|
File.directory?(entry) && File.exists?(entry + "/index.theme") && File.exist?(entry + "/gtk-3.0")
end.sort!
theme_names = themes_dir.sort.map { |dir| File.basename(dir) }
theme_names.each do |theme_name|
sleep 60 # 60 is 1 minute. Change it according to your need.
@AnwarShah
AnwarShah / 99-autohint-opentype.conf
Created February 25, 2018 05:30
Enable autohint for open type fonts since default hinting looks blurry
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- enable autohint for open type fonts -->
<match target="font">
<test name="fontformat">
<string>CFF</string>
</test>
<edit name="autohint" mode="assign">
@AnwarShah
AnwarShah / 99-replace-thin.conf
Created February 25, 2018 04:02
Replace thin fonts with ultralight using fontconfig
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- replace thin fonts for fira with ultralight, since thin is too light -->
<match target="font">
<test name="family" compare="contains">
<string>Fira Sans</string>
</test>
<test name="weight" compare="less_eq">
@AnwarShah
AnwarShah / cdparanoia.patch
Created September 9, 2016 13:11
A modified patch of cdparanoia
Index: cdparanoia.1
===================================================================
--- cdparanoia.1 (revision 18965)
+++ cdparanoia.1 (working copy)
@@ -207,6 +207,11 @@
known user data area of the disc, probably causing read errors on most
drives and possibly even hard lockups on some buggy hardware.
+.TP
+.BI "\-x --force-overread