Skip to content

Instantly share code, notes, and snippets.

View AnwarShah's full-sized avatar

Anwar AnwarShah

View GitHub Profile
@AnwarShah
AnwarShah / gui-for-shell
Created October 25, 2016 10:22
shell gui
Bash is a Shell. A shell is a command-line interpreter, an interface for you to call other programs/commands. That's why it is called **Command Line Interface** or CLI. So, a shell scripting language provides constructs that facilitates this interaction only, but never provides GUI tools to build graphical interface. It's not a full-fledge language with its own graphical components. You can use these shells to call other CLI tools (most commonly) and sometimes a GUI tool (like [zenity][1]).
Since Shells never provide gui building support, there can be no question of having a GUI building tool for them.
Yes, as I already said, you can use [zenity][1] and other similar tools to bring GUI components, but those are third party libraries called from bash, not bash things themselves (Zenity is a GNOME tool).
Check the answer to a similar [question here][2] on [unix.se]. Also check this question on Stack overflow
- [How to make a GUI for bash scripts?][3]

Keybase proof

I hereby claim:

  • I am anwarshah on github.
  • I am anwarshah (https://keybase.io/anwarshah) on keybase.
  • I have a public key ASBBr4h6EKDnzwzcJUkkHVgDv8Ar1V57hf0zlJ0oUo1KsAo

To claim this, I am signing this object:

@AnwarShah
AnwarShah / rspec_rails_cheetsheet.rb
Created February 21, 2017 19:35 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@AnwarShah
AnwarShah / jdk_download.sh
Created April 12, 2017 16:14 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@AnwarShah
AnwarShah / ppas.list
Created April 20, 2017 06:21
My Xenial Xerus 16.04 PPA list
deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /
deb http://ppa.launchpad.net/docky-core/stable/ubuntu xenial main
deb http://ppa.launchpad.net/elementary-os/stable/ubuntu xenial main
deb http://ppa.launchpad.net/embrosyn/cinnamon/ubuntu xenial main
deb http://ppa.launchpad.net/fontforge/fontforge/ubuntu xenial main
deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu xenial main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
deb https://cli-assets.heroku.com/branches/stable/apt ./
@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 / 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 / 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 / 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 / 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.