Skip to content

Instantly share code, notes, and snippets.

View bashkirtsevich's full-sized avatar
:octocat:
bashkirtsevich.github.io

D.A.Bashkirtsev bashkirtsevich

:octocat:
bashkirtsevich.github.io
View GitHub Profile
@bashkirtsevich
bashkirtsevich / del.md
Created April 12, 2021 09:04
Delete old logs

Delete all files:

find /var/log -type f -delete

Delete all .gz and rotated file

find /var/log -type f -regex ".*\.gz$"
find /var/log -type f -regex ".*\.[0-9]$"
@bashkirtsevich
bashkirtsevich / docker-compose.yml
Created April 8, 2021 13:51
nextcloud nginx letsencrypt
# https://rtfm.co.ua/nextcloud-zapusk-v-docker-compose-na-debian-s-ssl-ot-lets-encrypt/
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy:0.4.0
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
container_name: nextcloud-proxy
networks:
- nextcloud_network
@bashkirtsevich
bashkirtsevich / changelog.sh
Created September 28, 2020 08:17
Git changelog by last week
git log --oneline --decorate --since="1 week ago" --pretty=%ad%x09%s
@bashkirtsevich
bashkirtsevich / re.md
Created September 15, 2020 11:13
Regex look ahead/behind
(?<=\s|^)         #to look behind the match
(stackoverflow)   #the string you want. () optional
(?=\s|$)          #to look ahead.
@bashkirtsevich
bashkirtsevich / demo.sh
Last active August 12, 2020 14:48
Docker build from stdin
docker build -t imagename -<<EOF
FROM python:3.8.3
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install swig pkg-config libboost-dev libsndfile1-dev libboost-all-dev cmake protobuf-compiler libprotoc-dev
EOF
@bashkirtsevich
bashkirtsevich / copylibs.sh
Last active July 14, 2020 18:26
Copy libs
#!/bin/bash
libs=$(./lddtree -l $1 | grep -E "\.so$|\.so\..+$")
# find /usr/local/lib/python3.8/ \( -iname "*.so" -o -iname "*.so.*" \) -exec sh -c '~/lddtree -l {} | grep -E "\.so$|\.so\..+$" | grep -v "lib/python3.8/"' \; | sort -u
mkdir libs
for lib in $libs
do
real_path=$(readlink -f $lib)
root@63f81279153e:/etc/ld.so.conf.d# cat libc.conf
# libc default configuration
/usr/local/lib
root@63f81279153e:/etc/ld.so.conf.d# cat x86_64-linux-gnu.conf
# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
@bashkirtsevich
bashkirtsevich / demo.sh
Last active July 10, 2020 13:08
Diff only added
diff -u fs_state1 fs_state2 | grep -E "^\+/" | sed 's/^\+//g' | less
@bashkirtsevich
bashkirtsevich / mk_astra_image.sh
Created July 7, 2020 06:31
Make Astra Linux docker base image
#!/usr/bin/env bash
#
# Create a base Astra Linux Docker image.
#
# Original code: https://github.com/slaykovsky/mk_astra_image/blob/master/mk_astra_image.sh
set -ex
usage() {
cat <<EOOPTS
@bashkirtsevich
bashkirtsevich / restyle.css
Created July 2, 2020 17:48
GitHub restyle
.avatar-user {
border-radius: 3%!important;
}
.btn {
box-shadow: 0 2px 0 rgba(27,31,35,.04), inset 0 1px 0 hsla(0,0%,100%,.25) !important;
}
.btn {
border-radius: 3px !important;