This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
print(''.join(traceback.format_exception(etype=type(error), value=error, tb=error.__traceback__))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext, useContext, useState } from "react" | |
export type Permission = string | |
interface IPermissionContextType { | |
isAllowedTo: (permission: Permission) => boolean | |
} | |
const PermissionContext = createContext<IPermissionContextType>({ | |
isAllowedTo: () => false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install clamav clamav-daemon | |
sudo systemctl enable clamav-daemon | |
sudo systemctl start clamav-daemon | |
sudo nano /etc/systemd/system/clamdscan-home.service | |
# copy following content into it | |
[Unit] | |
Description=ClamAV virus scan | |
Requires=clam-daemon.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If epel-release is available | |
sudo yum install epel-release | |
else | |
sudo amazon-linux-extras install epel | |
sudo yum -y install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd | |
sudo freshclam | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats '%b' | |
# Set up the prompt (with git branch name) | |
setopt PROMPT_SUBST | |
PROMPT='%F{blue}%n%F{yellow}@%F{green}${PWD/#$HOME/~} %F{red}(${vcs_info_msg_0_}) %F{yellow}$%F{reset_color} ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status -sb | |
a = add . | |
co = checkout | |
cob = checkout -b | |
last = log -1 head | |
cane = commit --amend --no-edit | |
lo = log --oneline -n 10 | |
pr = pull --rebase --prune | |
cm = commit -m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
TEST_VAR, | |
) = [ | |
dict(os.environ)[k] | |
for k in ( | |
"TEST_VAR", | |
) | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update && sudo apt-get upgrade | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake git unzip pkg-config make libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev | |
mkdir -p venv/opencv | |
sudo apt-get install python3-dev | |
python3 -m venv venv/opencv/ | |
source venv/opencv/bin/activate | |
pip install numpy | |
git clone --depth=1 https://github.com/opencv/opencv.git opencv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Patient's Name. Patient ID birth date series UID. series UID Institution Name Institution Address Accession Number physician operator sop UID other pat ids study id Image Comments | |
dcmodify -ie -gin -nb -ea "(0010,0010)" -ea "(0010,0020)" -ea "(0010,0030)" -ea "(0020,000E)" -ea "(0020,000D)" -ea "(0008,0080)" -ea "(0008,0081)" -ea "(0008,0050)" -ea "(0008,0090)" -ea "(0008,1070)" -ea "(0008,1155)" -ea "(0010,1000)" -ea "(0020,0010)" -ea "(0020,4000)" *.dcm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pprint | |
def get_all_files(path, min_size_kb=None): | |
for root, dirs, files in os.walk(path): | |
for file_ in files: | |
path = os.path.abspath(os.path.join(root, file_)) | |
size = (os.path.getsize(path)) // 1024 | |
if size >= min_size_kb: |