Skip to content

Instantly share code, notes, and snippets.

View ma-sadeghi's full-sized avatar
🏠
Working from home

Amin Sadeghi ma-sadeghi

🏠
Working from home
View GitHub Profile
@bondarenkod
bondarenkod / git-windows-ssh.md
Last active May 2, 2024 18:26
Git SSH: Permission denied (publickey). fatal: Could not read from remote repository.

If you encounter the following error on Windows: Permission denied (publickey). fatal: Could not read from remote repository. But at the same time, the command ssh -vT git@github.com gives you this message: Hi USER_NAME! You've successfully authenticated, but GitHub does not provide shell access.

  • Add to your environment variables: GIT_SSH_COMMAND="C:/Windows/System32/OpenSSH/ssh.exe". Ensure there's no space after the equal sign. Also, verify that the path is correct for your OS.
  • Alternatively, change the Git configuration by running: git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@okld
okld / multipage_settings_app.py
Last active July 11, 2024 23:55
Streamlit - Settings page with session state
import streamlit as st
from persist import persist, load_widget_state
def main():
if "page" not in st.session_state:
# Initialize session state.
st.session_state.update({
# Default page.
"page": "home",
@tvst
tvst / SessionState.py
Last active April 14, 2024 20:24
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@ArnoutDevos
ArnoutDevos / Remove_notebook_checkpoints.sh
Created December 7, 2018 10:08
command to remove automatically created .ipynb_checkpoints folders and their checkpoints
rm -rf `find -type d -name .ipynb_checkpoints`
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active July 19, 2024 16:23 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@font-face {
font-family: SegoeUI;
src:
local("Segoe UI Light"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format("woff2"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format("woff"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format("truetype");
font-weight: 100;
}
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 19, 2024 18:06
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

@briantjacobs
briantjacobs / config.yml
Created November 24, 2015 19:43
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@rxaviers
rxaviers / gist:7360908
Last active July 20, 2024 10:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: