Skip to content

Instantly share code, notes, and snippets.

View AnwarShah's full-sized avatar

Anwar AnwarShah

View GitHub Profile
@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 / 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 / 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 / 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 / capybara cheat sheet
Created January 18, 2016 06:29 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@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 / application.css.scss
Created November 1, 2015 15:40 — forked from victorbstan/application.css.scss
Overriding will_paginate gem to provide a drop-down select html tag list for all the page.
.pagination {
display:inline-block;
form {
display: inline-block;
margin:0;
select {
width:100px;
}
}
}
@AnwarShah
AnwarShah / zsh.md
Last active August 29, 2015 14:27 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu