| title | Shell Notes |
|---|---|
| date | 2019-10-16 16:41:23 +0800 |
| draft | true |
. ~/.zshrc| #!/usr/bin/env bash | |
| # | |
| # Copyright (c) .NET Foundation and contributors. All rights reserved. | |
| # Licensed under the MIT license. See LICENSE file in the project root for full license information. | |
| # | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| current_userid=$(id -u) | |
| if [ $current_userid -ne 0 ]; then |
| conda config --set auto_activate_base false |
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\SDK\ScopeCppSDK\VC\lib; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\SDK\ScopeCppSDK\SDK\lib;
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\SDK\ScopeCppSDK\SDK\include\ucrt; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\SDK\ScopeCppSDK\VC\bin; C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\SDK\ScopeCppSDK\SDK\bin;
| import boto3 | |
| from botocore.client import Config | |
| from rasterio.io import MemoryFile | |
| session = boto3.session.Session() | |
| client = session.client( | |
| service_name="s3", | |
| endpoint_url="http://localhost:9000", | |
| aws_access_key_id='KEY', | |
| aws_secret_access_key="SECRET" |
| from zipfile import ZipFile | |
| from pathlib import Path | |
| target_directory = "." | |
| with ZipFile(src, 'r') as f: | |
| for file_name in f.namelist(): | |
| file_name = f.extract(file_name, path=target_directory) | |
| try: |
| import os | |
| import tinify | |
| tinify.key = "your key" | |
| root = "./images" | |
| dst_path = "./images-compress" | |
| for origin, _, files in os.walk(root, topdown=False): | |
| for name in files: |
| #! /bin/bash | |
| blog_path=~/path/to/blog | |
| cd $blog_path | |
| hugo new --editor typora posts/$1.md |
| SetStoreCapsLockMode False | |
| CapsLock:: | |
| { | |
| KeyWait "CapsLock" | |
| time := A_TimeSinceThisHotkey | |
| if (time > 300) { | |
| SetTimer SendCaps, -4 | |
| } | |
| else { |
| // https://blog.codetitans.pl/post/sending-ctrl-c-signal-to-another-application-on-windows/ | |
| [DllImport("kernel32.dll", SetLastError = true)] | |
| static extern bool AttachConsole(uint dwProcessId); | |
| [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] | |
| static extern bool FreeConsole(); | |
| [DllImport("kernel32.dll")] | |
| static extern bool SetConsoleCtrlHandler(ConsoleCtrlDelegate handler, bool add); |