Skip to content

Instantly share code, notes, and snippets.

<mso:cmd app="OneNote" dt="0" />
<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
<mso:ribbon>
<mso:qat>
<mso:sharedControls>
<mso:control idQ="mso:ViewGoBack" visible="true"/>
<mso:control idQ="mso:RedoButton" visible="false" insertBeforeQ="mso:ViewGoForward"/>
<mso:control idQ="mso:FilePrint" visible="false" insertBeforeQ="mso:ViewGoForward"/>
<mso:control idQ="mso:FilePrintPreview" visible="false" insertBeforeQ="mso:ViewGoForward"/>
<mso:control idQ="mso:FavoritePen1" visible="false" insertBeforeQ="mso:ViewGoForward"/>
# This script changes the priority of the ‘Code.exe’ process to real-time.
# List of possible priority states in Windows:
# 0: Idle
# 1: Below Normal
# 2: Normal
# 3: Above Normal
# 4: High
# 5: Real Time
# Function to change process priority
@lokswin
lokswin / switch_git_account.py
Last active February 8, 2024 14:46
Switch for git accounts
# Import the subprocess module to run shell commands
import subprocess
login1 = 'log111'
login2 = 'log222'
email1 = 'em111@gmail.com'
email2 = 'em222@cloud.com'
print("This is a switch between 2 global git accounts:")
@lokswin
lokswin / change_extension.py
Last active February 8, 2024 14:50
Renames the files with the correct extensions
"""
File Extension Determination Script
This script scans files in the current directory and attempts to determine their file extensions
based on file signatures. It then renames the files with the correct extensions.
Supported File Signatures:
- ZIP: 504B0304
- PDF: 25504446
- JPG: FFD8FFE0
@lokswin
lokswin / create_user_and_api_key.py
Last active February 8, 2024 14:49
Script automates the process of generating an token key, and a new service account
# file: create_user_and_api_key.py
######################################################################
# Grafana Automation Script
#
# This script automates the process of generating an token key, creating
# a new service account (user) Ensure that you set the necessary
# environment variables(gitlab) before running the script.
#
# Author: Taras
@lokswin
lokswin / query_grafana_list.txt
Last active February 8, 2024 14:52
Query Grafana
# This file is a list of useful Grafana queries
# select job then select container then print only log field from json
{job="fluent-bit"} |~ `$doc_container_name` | json output="log" | line_format `{{.output}}`
@lokswin
lokswin / .bashrc
Last active November 3, 2023 11:38
# Faster Makefiles. (jobs,threads, makefile)
# export MAKEFLAGS=-j$(($(grep -c ^processor /proc/cpuinfo) - 1))
# export MAKEFLAGS=-l
# export MAKEFLAGS=-j
# alias make='make -j'
# MAKEFLAGS += --output-sync=target
# export MAKE=-j
export MAKEFLAGS=-j72
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)