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
| " commentry Plugin | |
| :set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " vundle | |
| Plugin 'VundleVim/Vundle.vim' | |
| " theme | |
| Plugin 'liuchengxu/space-vim-dark' | |
| " nerd tree and tagbar |
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
| git diff -p \ | |
| | grep -E '^(diff|old mode|new mode)' \ | |
| | sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \ | |
| | git apply |
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
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>List of Links</title> | |
| </head> | |
| <body> | |
| <h1>Links</h1> | |
| <ul> |
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
| from typing import List | |
| from pprint import pprint | |
| import argparse | |
| import wikipedia | |
| def search_for_results(search: str, limit: int) -> List[str]: | |
| wikipedia.set_lang("en") | |
| search_result_list = wikipedia.search(query=search, results=limit) |
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
| stream { | |
| server { | |
| listen xxx; | |
| ssl_certificate /etc/xxx/xxx.crt; | |
| ssl_certificate_key /etc/xxx/xxx/xxx.key; | |
| ssl_dhparam /etc/xxx/xxx/ssl-dhparams.pem; | |
| ssl_protocols TLSv1.3 TLSv1.2; | |
| ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; | |
| ssl_prefer_server_ciphers off; |
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
| from datetime import timedelta | |
| import pandas | |
| def read_csv(file_name): | |
| file_name_with_extension = f"{file_name}.csv" | |
| df = pandas.read_csv(file_name_with_extension, parse_dates=["Date"]) | |
| df = df[["Zone", "Date", "Status Code", "Response Time"]] | |
| return df |
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
| cp wg-up-down.sh /usr/loca/bin/wg-up-down | |
| chmod +x /usr/local/bin/wg-up-down | |
| # set img | |
| # add .desktop to ~/.config/xfce4/panel/launcher-x/ |
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
| ... | |
| action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$ | |
| slack[name=%(__name__)s] | |
| action = %(action_with_slack_notification)s | |
| ... |
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
| num_list = [2, 4, 1, 6, 40, 2, 24, 3, 1, 5, 6, 8, 12, 9, 31, 45, 7, 14, 19, 20] | |
| count = 5 | |
| paritioned_list = [] | |
| for i in range(count-1): | |
| paritioned_list.append(num_list[i*count:(i+1)*count]) | |
| two_d_4x4 = [ | |
| list(set(first_list).intersection(second_list)) | |
| for first_list in paritioned_list | |
| for second_list in paritioned_list |