Skip to content

Instantly share code, notes, and snippets.

View colorwebdesigner's full-sized avatar

Ivan Pro colorwebdesigner

View GitHub Profile
@colorwebdesigner
colorwebdesigner / pcinfo.sh
Last active February 24, 2022 22:52
Tested on GNU Linux Debian system. Collect general inormation about PC hardware, generate nice report and print to cli or file.
#!/bin/bash
# pcinfo.sh
# ---
# Collect general inormation about PC hardware,
# generate nice report and print to cli or file
# --------------------------------------------------------
# author : ip@spiderlab.ru
# license : GNU
# date : 17.02.2022
# src : https://gist.github.com/colorwebdesigner/b8cd5225741066c502c2f9435f7ae47a
@colorwebdesigner
colorwebdesigner / modx_update.sh
Last active February 12, 2022 09:56
MODx Revolution advanced update and backup script
#!/bin/bash
# modx_update
#
# MODx Revo advanced update script
# 1) Put this file in your website folder
# 2) Make it executable
# 3) Run
# --------------------------------------------------------
# Script will automaticaly find all configs, core folder
# (even if you change default name and location), make
@colorwebdesigner
colorwebdesigner / system-updater.sh
Last active February 12, 2022 08:56
CLI GUI for linux system update and upgrade
#!/bin/bash
# system-updater
# ---
# CLI GUI for system update and upgrade
# --------------------------------------------------------
# author: Ivan Pro Tools
# github: https://github.com/colorwebdesigner
# date: 17-01-2022
# license: GNU
# --------------------------------------------------------
@colorwebdesigner
colorwebdesigner / translit.sh
Created January 26, 2021 19:51
Bash transliteration script
#!/bin/bash
# translit function
# ----------------------
translit() {
local trs="${1// /-}"
trs=$(sed "y/абвгдезийклмнопрстуфхцы/abvgdezijklmnoprstufxcy/" <<< "${trs}")
trs=$(sed "y/АБВГДЕЗИЙКЛМНОПРСТУФХЦЫ/ABVGDEZIJKLMNOPRSTUFXCY/" <<< "$trs")
trs=${trs//ч/ch}
<?
$filter = Array ("xxxxxxx" => "xx");
$rsUsers = CUser::GetList(($by="ID"), ($order="asc"), $filter);
while($rsUsers->NavNext(true, "f_")) :
echo "[".$f_ID."] (".$f_LOGIN.") ".$f_NAME." ".$f_LAST_NAME."<br>";
endwhile;
?>
@colorwebdesigner
colorwebdesigner / btrx-rcpass-restore.php
Created August 19, 2020 11:41
Bitrix backup password restore
/*
--------------------------------------
Restore backup password
start from PHP console in your Bitrix admin
--------------------------------------
*/
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/backup.php");
var_dump(CPasswordStorage::Get('dump_temporary_cache'));
# For root user
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;34m\]@\h:\[\033[;033m\]\w\[\033[00m\] \$ "
# For common user
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[01;34m\]@\h:\[\033[;033m\]\w\[\033[00m\] \$ "
@colorwebdesigner
colorwebdesigner / issue
Last active June 27, 2020 15:36
Sample content of `/etc/issue` file for Debian based systems
============================================================
Welcome to \n.\o server, stranger!
I see that you are trying to log on \l at \t,
so i make note about it in my log file and report my master.
Big brother already watching you.
------------------------------------------------------------
I'm based on Debian GNU/\s \r, so be jentle,
like other \U inside.
============================================================
@colorwebdesigner
colorwebdesigner / http_dowload.sh
Last active June 17, 2020 20:33
check curl or wget is install and dowload with progress bar
#!/bin/bash
# ============================
# Found in install.sh from dnote
# https://github.com/dnote/dnote/blob/master/install.sh
# ============================
http_download() {
dest=$1
srcURL=$2
if is_command curl; then
@colorwebdesigner
colorwebdesigner / mikrotik.setNtpServers.sh
Last active November 24, 2022 18:27
Mikrotik script (.sh only for syntax highlighting)
# ==============================
# setNtpServers
# ==============================
# Mikrotik RB951G-2HnD
# RouterOS v6.46.4 (stable)
# ---
# Corrects IP addresses of NTP servers in
# System -> NTP Client (if they have changed),
# resolve IPs by NTP domains and send message
# to Slack.