Skip to content

Instantly share code, notes, and snippets.

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
Possibly missing firmware for module: wd719x
Possibly missing firmware for module: xhci_pci
@imitronov
imitronov / index.html
Created February 21, 2020 14:04
base64 image 1x1 px for valid HTML with lazyload
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMAQObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII=" data-src="http://placehold.it/100x100" class="lazy">
@imitronov
imitronov / wp-admin-add-posts-state.php
Created February 10, 2020 08:53 — forked from martijn94/wp-admin-add-posts-state.php
Snippet to add post state to a WordPress page
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
@imitronov
imitronov / demo.html
Last active February 4, 2019 07:26
open share links to new window
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Share demo</title>
</head>
<body>
<a data-share href="https://www.facebook.com/sharer.php?src=sp&u=http://github.com">FACEBOOK</a>
@imitronov
imitronov / docker-help.md
Created November 6, 2018 18:07 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@imitronov
imitronov / mysqldump.php
Created September 18, 2018 06:44 — forked from micc83/mysqldump.php
Simple PHP script to dump a MySql database
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$database = 'db';
$user = 'user';
$pass = 'pass';
$host = 'localhost';
@imitronov
imitronov / load.js
Created October 24, 2017 08:27
Отложенная загрузка
var scripts = new Array(
),
css = new Array(
'/assets/css/main.min.css'
);
function downloadJSAtOnload() {
var element;
for(var i = 0; i < scripts.length; i++){
element = document.createElement("script");
@imitronov
imitronov / ftp_backup.php
Created October 19, 2017 17:28
Бэкап через FTP. Занимает очень много времени. Написан ради примера.
<?php
set_time_limit(0);
ignore_user_abort(true);
header("Connection: close");
ob_flush();
flush();
$ftp_server = '';
$ftp_user_name = '';
@imitronov
imitronov / .htaccess
Last active July 29, 2018 13:40
Идеальный htaccess
ErrorDocument 404 /404.php
<ifModule mod_rewrite.c>
RewriteEngine On
# переадресация www.domain.com -> domain.com
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
@imitronov
imitronov / scan.php
Created October 19, 2017 17:22
Сканирование сайта на наличие исполняемого eval js кода
<?php
function scanVirus($dir) {
    $files = scandir($dir);
    foreach($files as $file) {
        if(is_file($dir.$file) and pathinfo($file, PATHINFO_EXTENSION) == 'js') {
            $content = trim(file_get_contents($dir.$file));
            $pattern = '#var ([a-zA-Z0-9]+)="(.[^\"]*)",([a-zA-Z0-9]+)="";for\(var ([a-zA-Z0-9]+)=(.*?).length-1;(.*?)>0;(.*?)--\){if\((.*?)%2==1\)(.*?)+=(.*?).charAt\((.*?)\)}eval\((.*?)\);#mi';