Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# ###########################################
# Title :PrinTxt
# Description :This script print given text with different style
# Author :Rashko Petrov
# Website :https://rashkopetrov.dev
# GitHub :https://gist.github.com/rashkopetrov/4a4a96b1c83f4c8cc82497065cd3d266/
# Date :2021-07-07
# Version :0.21.07.07 - 2021-07-07
# Usage :bash printxt.sh [option] [text]
@rashkopetrov
rashkopetrov / fix-broken-apt-get-update.sh
Last active August 30, 2024 12:42
Fix `Error: Timeout was reached ` when doing `apt-get update`
#!/bin/bash
# source: https://www.linuxquestions.org/questions/debian-26/apt-get-update-gets-stuck-while-reading-package-list-on-my-slug-795324/
mv /var/lib/dpkg/status /var/lib/dpkg/status.broken.bak
cp /var/lib/dpkg/status-old /var/lib/dpkg/status
rm -rf /var/lib/apt/lists/*
dpkg --configure -a
aptitude update
aptitude upgrade
@rashkopetrov
rashkopetrov / books.md
Created March 5, 2018 15:16 — forked from abstractart/books.md
Free Programming Ebooks - O'Reilly Media
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
@rashkopetrov
rashkopetrov / mongodb_and_php7.md
Last active December 3, 2019 14:28
Install MongoDB and make it work with PHP 7.0

Install MongoDB

  1. Import the public key used by the package management system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
  1. Create a list file for MongoDB.
@rashkopetrov
rashkopetrov / composer_warning_PHP_extension_mongodb_is_missing.md
Last active June 12, 2016 13:51
Composer -- Issue/Fix -- Composer can't find mongodb extension

Composer can't find mongodb extension

Solution found at github

Warning:

mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
  1. Install mongodb
@rashkopetrov
rashkopetrov / disable_transparent_huge_pages.md
Created June 12, 2016 13:27
Ubuntu -- Fix -- Disable Transparent Huge Pages (THP)

Disable Transparent Huge Pages (THP)

  1. Create the disable-transparent-hugepages file at /etc/init.d/disable-transparent-hugepages with the following content:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          disable-transparent-hugepages
# Required-Start:    $local_fs
# Required-Stop:
@rashkopetrov
rashkopetrov / commit-with-fake-date.php
Last active June 12, 2016 13:52
Cheating - Git Commit By Date
<?php
function getPostValue( $name ) {
if ( empty( $_POST[ $name ] ) ) {
return '';
}
return $_POST[ $name ];
}
function printOldValue( $name = '' ) {
@rashkopetrov
rashkopetrov / encrypted_home_fix_swap.md
Last active June 12, 2016 13:29
Ubuntu -- Fix -- Fix Swap When The Home Is Encrypted

Fix Swap When The Home Is Encrypted

  1. Open: /etc/crypttab
cryptswap1 UUID={uid code 1} /dev/urandom swap,cipher=aes-cbc-essiv:sha256
cryptswap2 UUID={uid code 2} /dev/urandom swap,cipher=aes-cbc-essiv:sha256
  1. Run: