Skip to content

Instantly share code, notes, and snippets.

View 7aman's full-sized avatar
❤️

Zaman 7aman

❤️
View GitHub Profile
@7aman
7aman / ffspeed.sh
Last active July 12, 2019 11:09
speed up or speed down whole or a part of a video #ffmpeg
#!/bin/sh
_usage="Usage:\n ffspeed input output speed\n ffspeed input output speed from\n ffspeed input output speed from to"
_version="0.0.1"
function display_usage() {
echo -e "\nffspeed version $_version"
echo -e "$_usage"
}
function all_speed {
@7aman
7aman / add-user-to-wireshark.sh
Last active March 28, 2019 09:41
If wireshark does not list your interfaces, use this command
sudo usermod -a -G wireshark $USER
# Then Reboot Or "Log Out and Log In"
@7aman
7aman / fstab
Created March 28, 2019 09:03
Mount permanently an additioanl ntfs partition at boot
/dev/sdb1 /home/user/Data ntfs-3g defaults,locale=en_US.utf8 0 0
@7aman
7aman / fix-opera.md
Last active March 15, 2024 21:14
fix opera's error that can not play some video files.

Error:

Opera does not play some videos and shows this error message:
"The media could not be loaded, either because the server or network failed or because the format is not supported."

Cause:

Opera has a liciensing issue. It has a libffmpeg.so library but does not works.

Solution:

There is a solution for debian based distros. Link
Opera is based on Chromium which has a working libffmpeg.so. Just replace opera's.

@7aman
7aman / publickey-git-error.markdown
Last active December 16, 2020 09:07 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@7aman
7aman / sqlite3-in-python.py
Created January 21, 2019 07:29
sqlite3 cheatsheet for python 3
#!/usr/bin/env python3
'''
Thanks to Andres Torres
Source: https://www.pythoncentral.io/introduction-to-sqlite-in-python/
'''
import sqlite3
# Create a database in RAM
@7aman
7aman / msshare.sh
Created December 22, 2018 13:54
Mount a shared folder from a windows host.
#!/bin/bash
command -v mount.cifs >/dev/null 2>&1 || {
echo "I require mount.cifs but it's not installed. You can install via apt:" >&2;
echo " sudo apt-get install cifs-utils"
echo ""
echo "Press any key to abort."
read
exit 1;
}
@7aman
7aman / background.js
Last active December 15, 2022 17:29 — forked from danharper/background.js
Bare minimum Firefox extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
browser.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
browser.tabs.executeScript(tab.id, {
file: 'inject.js'
});
});
python3 -m pip install -U $(python3 -m pip freeze | cut -d"=" -f1)
python2 -m pip install -U $(python2 -m pip freeze | cut -d"=" -f1)

Source