Skip to content

Instantly share code, notes, and snippets.

View Utshaw's full-sized avatar
🎯

Farhan Tanvir Utshaw

🎯
View GitHub Profile
@Utshaw
Utshaw / installer.sh
Last active April 19, 2025 16:43
install atheros AR9271 driver on Ubuntu
# Add this line in /etc/apt/sources.list
# deb http://httpredir.debian.org/debian/ jessie main contrib non-free
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CBF8D6FD518E17E1
sudo apt-get update --allow-unauthenticated
sudo apt-get install firmware-atheros
sudo dpkg -i --force-overwrite /var/cache/apt/archives/firmware-atheros_0.43_all.deb # if error says error processing archive /var/cache/apt/archives/firmware-atheros_0.43_all.deb
sudo apt -f install # to fix broken packages
@Utshaw
Utshaw / NTFS_mount.sh
Last active May 25, 2020 02:53
Mount NTFS file system with read/write option
Turn off windows cache for the specific drive from windows 10: https://www.maketecheasier.com/disable-disk-write-caching-windows10/
On Ubuntu (make sure sda1 is unmounted): sudo mount -t ntfs-3g /dev/sda1 /mnt/ntfs/
The above command can give following error:
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
For resolving the above error:
sudo ntfsfix /dev/sda1
@Utshaw
Utshaw / pythonlinker.sh
Created April 20, 2020 03:54
python package not found though python3 installed
sudo ln -s /usr/bin/python3 /usr/bin/python
@Utshaw
Utshaw / ssh_key_adder.sh
Last active April 18, 2020 08:05
Add SSH key to GitHub
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
gedit ~/.ssh/id_rsa.pub
@Utshaw
Utshaw / audio_solver.sh
Created April 11, 2020 02:56
Solve audio issues where voice can't be heard but music plays well
ffmpeg -i Star.Wars.The.Clone.Wars.S07E08.720p.WEB.H264-GHOSTS\[eztv\].mkv -c:a libmp3lame -q:a 4 star.mp3
ffmpeg -i Star.Wars.The.Clone.Wars.S07E08.720p.WEB.H264-GHOSTS\[eztv\].mkv -i star.mp3 -c:v copy -map 0:v:0 -map 1:a:0 StarWars.mkv
@Utshaw
Utshaw / diffmerge_installation.sh
Last active November 28, 2024 09:49
Install diffmerge tool on Ubuntu
1. Download diffmerge from here: https://drive.google.com/file/d/1K4myLVDTTLngX7hYR2kE8bmMH-XBAa53/view?usp=sharing
2. sudo add-apt-repository ppa:linuxuprising/libpng12
3. sudo apt update
4. sudo apt install libpng12-0
5. Goto Downloads
6. sudo dpkg -i diffmerge_3.3.2.1139-1_amd64.deb
@Utshaw
Utshaw / install_p4merge.sh
Created April 10, 2020 05:54
Install p4merge diff tool in Ubuntu
# Install from : https://www.perforce.com/downloads/visual-merge-tool
cd ~/Downloads
# Move p4v-2019.2.1904275 from inside some parent folder to ~/Downloads/
tar zxvf p4v*.tgz
sudo mkdir /opt/p4v
cd p4v-*
sudo mv * /opt/p4v
sudo ln -s /opt/p4v/bin/p4merge /usr/local/bin/p4merge
@Utshaw
Utshaw / install.log
Created April 10, 2020 05:52 — forked from crmaxx/install.log
Installing and configuring P4Merge for Git on Ubuntu
# based on http://blogs.pdmlab.com/alexander.zeitler/articles/installing-and-configuring-p4merge-for-git-on-ubuntu/
$ cd ~/Downloads
$ wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz
$ tar zxvf p4v.tgz
$ sudo mkdir /opt/p4v
@Utshaw
Utshaw / Base64KeyHashAndroid.java
Created December 2, 2019 06:22
Convert SHA-1 key to Base 64 Call this function from MainActivity.java file
private void printKeyHash() {
try {
PackageInfo info = getPackageManager().getPackageInfo(getApplicationContext().getPackageName(),
PackageManager.GET_SIGNATURES);
for(Signature signature: info.signatures){
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
@Utshaw
Utshaw / check for a key and insert if not exists
Created July 4, 2019 06:33
check for a key and insert if not exists
map<char, int> :: iterator iter = charFrequency.find(a);
if(iter == charFrequency.end() ){ // not found
charFrequency.insert({a, 1});
}else{ // found
iter->second = iter->second + 1;
}