Skip to content

Instantly share code, notes, and snippets.

View Hansimov's full-sized avatar

Hansimov

View GitHub Profile
wget --user=<username> --ask-password <url> --no-check-certificate
@Hansimov
Hansimov / useful-git-cmds.md
Last active April 14, 2023 07:41
Collection of useful git commands in daily work

List some useful git commands.

@Hansimov
Hansimov / useful linux cmds.md
Last active September 5, 2023 03:52
Collection of useful Linux commands in daily work

List some useful Linux commands here.

@Hansimov
Hansimov / linux_term_color.py
Last active June 4, 2022 00:54
Linux terminal print colorful text
def print_format_table():
"""
prints table of formatted text format options
"""
for style in range(8):
for fg in range(30,38):
s1 = ''
for bg in range(40,48):
format = ';'.join([str(style), str(fg), str(bg)])
s1 += '\x1b[%sm %s \x1b[0m' % (format, format)
@Hansimov
Hansimov / shell_cmd.py
Last active August 15, 2023 06:29
python run shell command and output to the console
# Color print
def color_str(s, level="info"):
msg_level_D = {
"shell": "1;36;40", # cyan
"success": "1;32;40", # green
"info": "1;34;40", # blue
"warn": "1;35;40", # magenta
"error": "1;31;40", # red
"hint": "1;33;40", # yellow
"mark": "1;37;42", # white + green
@Hansimov
Hansimov / disp_dict.py
Last active August 4, 2022 09:48
python pretty print a dict
# Color print
def color_str(s, level="info"):
msg_level_D = {
"shell": "1;36;40", # cyan
"success": "1;32;40", # green
"info": "1;34;40", # blue
"warn": "1;35;40", # magenta
"error": "1;31;40", # red
"hint": "1;33;40", # yellow
"mark": "1;37;42", # white + green