Skip to content

Instantly share code, notes, and snippets.

View viewv's full-sized avatar
🎯
Focusing

X=>Z viewv

🎯
Focusing
View GitHub Profile
@viewv
viewv / modelsim_installation.md
Created May 2, 2019 03:07 — forked from robodhruv/modelsim_installation.md
Sorting ModelSim installation issues

ModelSim Installation issues

Ubuntu 14.xx and above

Ignore this if you have not encountered any issue with the installation and running of ModelSim and Quartus on your system. You are very lucky. (Just Kidding! You have surely had this issue, only sorted.)

Hence assuming you have been following the procedure given in this guide. Most certainly, Quartus will install jsut fine, and so will ModelSim. The issue is in launching due to inappropriate linking etc.

Stage 1

This is the simplest error you would encounter. Navigate to the modelsim_ase folder and run:

@viewv
viewv / ffmpeg-extract-keyframes.sh
Created September 27, 2019 09:39 — forked from savvot/ffmpeg-extract-keyframes.sh
Extract only keyframes (I-frames) from video to images with console ffmpeg
ffmpeg -ss <start_time> -i video.mp4 -t <duration> -q:v 2 -vf select="eq(pict_type\,PICT_TYPE_I)" -vsync 0 frame%03d.jpg
@viewv
viewv / updater.py
Created November 30, 2019 07:33
A simple Clash config file downloader for Linux in python.
import os
import requests
from ruamel import yaml
from tqdm import tqdm
URL = "Your Url"
PATH = "Your Config Path"
NAME = "config.yml"
IPHOST = "127.0.0.1:1234" # external-controller
@viewv
viewv / sout.java
Created April 30, 2020 14:25
Prints a string to standard out
System.out.println("Hello World");
@viewv
viewv / Public Key
Created May 24, 2020 16:22
2020-05-25 at 00:22:41 CST
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA12zjdduKe6CLWALQPllROYKyr+72TAoJhgw1K5aOYYm8kG8fjfnd7DPZtSbzEVJDId7dUyeo9soXIYLNvkq9rWDYzPkVprQvgvgnYlhgVrnH6binXq+xw15Rc+krzTHQ7V6GmSmDH9IhR7LSf1WSI7279WlkoYG3oPMBG++6IoDclBhlCUk1U07XeldFeMPnLiwNZ2Tg0RNG6T+yA7ML8TYkTYnQmn4cFMotrhQQcHYz9kd2CkpWdH8RSINGuVTeQk+RWlyrfkUM+MYYXTf4vzSOLyJqA5GZB7KUtVuM7Sdon87lQQcIZ0a5fN0zXNh6Nw+usXcoNugEnCt7gCAOhwIDAQAB
@viewv
viewv / Public Key
Created May 24, 2020 16:26
2020-05-25 at 00:26:41 CST
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAojvho3WSWZEMnPhJiwqAZaTqCIO1BddRhvxMITTqsjkQUTo7141L/3vjE9BHRl9qvkwqZNyPkaFsVtUioiSCy7jUNea5Jt3i/5UHv7aTJM1aHcFTDyH+leUly60Ovdv8fyGc7WA3HHUM93XyW79dWBhobYrJZMkUMZHXzmqYJw5ozX1ZU+be+qMN8CO9B7YUxdB4Lr7WwcqN7a9TR8ZwwRRp/ZteQ27KFpg4gHR8Aiov24Ey6iNvQ56JqwBFf2ePO/IuYXxYX1X+4VRIBsUMF2XjEu4ms6Lga0JP5YAcnSUR8Acyy5h8UG0kcadUOznl5u4Wg7+CQBjFkakpYBeDDwIDAQAB
# viewv zsh config
### Sys level fix
# Local Fix
export LC_ALL=en_US.UTF-8
# Add Proxy
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
### End sys fix
### Zinit's
@viewv
viewv / des.py
Last active November 16, 2022 05:15
DES
import random
PC1 = [57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15,
7, 62, 54, 46, 38, 30, 22,
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4]
@viewv
viewv / MixColumns.py
Created November 20, 2022 11:18
MixColumns
PD = [
[0x02, 0x03, 0x01, 0x01],
[0x01, 0x02, 0x03, 0x01],
[0x01, 0x01, 0x02, 0x03],
[0x03, 0x01, 0x01, 0x02],
]
def gf3mpy(x, y):
p = 0b100011011
m = 0
@viewv
viewv / exponentiating_by_squaring_mod.py
Created November 25, 2022 08:45
Exponentiating by squaring with mod
def exp_mod(base,n,mod):
ans = 1
while n:
if n & 1:
ans = (ans * base) % mod
base = (base * base) % mod
n >>= 1
return ans