Skip to content

Instantly share code, notes, and snippets.

View stigfromsouth's full-sized avatar
👻

Alexander Belashev stigfromsouth

👻
  • LES LTD
  • Novocherkassk
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 23:19
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@sirbrillig
sirbrillig / pgsql_backup.sh
Last active July 23, 2024 11:54 — forked from dangerousbeans/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@opexxx
opexxx / vhd2raw.cmd
Created April 30, 2015 12:45 — forked from mwchambers/gist:1319382
convert VHD file to RAW Image
qemu-img convert -O raw source.vhd output.raw
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@jlinoff
jlinoff / mycrypt.py
Last active April 2, 2024 13:28
Simple python tool that demonstrates openssl -aes-256-cbc compatible encrypt/decrypt.
#!/usr/bin/env python
'''
Implement openssl compatible AES-256 CBC mode encryption/decryption.
*********************************
UPDATE: 2021-08-28
Apparently this no longer works out of the box. That is probavbly because the
pycrypto package is getting stale.
I found this hacky workaround to get things working but it is likely not safe:
@kubaceg
kubaceg / Dockerfile
Created May 4, 2017 07:30
Docker install ioncube extension (php 5.6)
RUN curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
&& tar -xvvzf ioncube.tar.gz \
&& mv ioncube/ioncube_loader_lin_5.6.so `php-config --extension-dir` \
&& rm -Rf ioncube.tar.gz ioncube \
&& docker-php-ext-enable ioncube_loader_lin_5.6