Skip to content

Instantly share code, notes, and snippets.

View morr's full-sized avatar
🏠
Working from home

Andrey Sidorov morr

🏠
Working from home
View GitHub Profile
@morr
morr / 1.dump
Last active June 3, 2022 10:17
osx crash dumps
Machine-check capabilities: 0x0000000000000c0a
family: 6 model: 158 stepping: 9 microcode: 236
signature: 0x906e9
Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
10 error-reporting banks
Processor 2: IA32_MCG_STATUS: 0x0000000000000005
IA32_MC0_STATUS(0x401): 0xf600134000040150
IA32_MC0_ADDR(0x402): 0x00007ff80de452ac
Processor 3: IA32_MCG_STATUS: 0x0000000000000005
IA32_MC0_STATUS(0x401): 0xf600134000040150
Machine-check capabilities: 0x0000000000000c0a
family: 6 model: 158 stepping: 9 microcode: 236
signature: 0x906e9
Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
10 error-reporting banks
Processor 2: IA32_MCG_STATUS: 0x0000000000000005
IA32_MC0_STATUS(0x401): 0xf600134000040150
IA32_MC0_ADDR(0x402): 0x00007ff80de452ac
Processor 3: IA32_MCG_STATUS: 0x0000000000000005
IA32_MC0_STATUS(0x401): 0xf600134000040150
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=298b7c0a-43d3-4264-b68a-067335221928 / ext4 errors=remount-ro 0 1
@morr
morr / ban_tor.sh
Last active October 5, 2015 15:10
# create a new set for individual IP addresses
#sudo su
#ipset -N tor iphash
# get a list of Tor exit nodes that can access $YOUR_IP, skip the comments and read line by line
#wget -q "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=8.8.8.8" -O -|sed '/^#/d' |while read IP
#do
# add each IP address to the new set, silencing the warnings for IPs that have already been added
# ipset -q -A tor $IP
#done
# filter our new set in iptables
@morr
morr / full-ffmpeg.sh
Last active December 13, 2016 12:44
Install full ffmpeg in debian wheezy (with aac(m4a) and x264 support)
# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@morr
morr / gist:acfdd4ba2ee75a5db45d
Last active August 28, 2015 21:16
moderation versions
[list]
[*] Для аниме описания должны быть уникальны, то есть не взяты с других сайтов. Проверяется это просто: ищется в Гугле фраза из правки пользователя вот [url=https://www.google.ru/search?sourceid=chrome&client=ubuntu&channel=cs&ie=UTF-8&q=%D0%9E%D0%BD+%D0%B8%D0%BC%D0%B5%D0%B5%D1%82+%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D0%BD%D0%BE%D1%81%D1%82%D1%8C+%D0%B2%D0%B8%D0%B4%D0%B5%D1%82%D1%8C+%D0%BF%D1%80%D0%B8%D0%B7%D1%80%D0%B0%D0%BA%D0%BE%D0%B2+%D0%B8+%D0%B4%D1%83%D1%85%D0%BE%D0%B2.+%D0%A0%D0%BE%D0%BA%D0%BE%D0%B2%D0%BE%D0%B9+%D0%B4%D0%B5%D0%BD%D1%8C+%D0%BF%D1%80%D0%B8%D1%85%D0%BE%D0%B4%D0%B8%D1%82+%D0%BA%D0%BE%D0%B3%D0%B4%D0%B0+%D0%BE%D0%BD+%D0%B2%D1%81%D1%82%D1%80%D0%B5%D1%87%D0%B0%D0%B5%D1%82+%D1%88%D0%B8%D0%BD%D0%B8%D0%B3%D0%B0%D0%BC%D0%B8+%D0%9A%D1%83%D1%87%D0%B8%D0%BA%D0%B8+%D0%A0%D1%83%D0%BA%D0%B8%D1%8E]так[/url]. Если находится полное совпадение (на любом сайте кроме Шикимори), значит это копипаста, и правку следует отклонить.
Для манги и персонажей описания могут быть взяты с других сайтов, но при этом
html, body {
height: 100%;
min-height: 100%;
}
html, body, div, span, p, a, em, img, strong, ul, b, u, i, dl, dt, dd, ol, form, label, table, tbody, tfoot, thead, tr, th, td, h1, h2, h3, h4, h5, h6, input, fieldset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
module ActiveCacher
def self.prepended target
cacher = self
target.send :define_singleton_method, :rails_cache do |*methods|
methods.each do |method|
escaped_method = method.to_s.include?('?') ? "is_#{method[0..-2]}" : method
cacher.send :define_method, method do |*args|
instance_variable_get("@#{escaped_method}") ||
@morr
morr / active_dispatch_fix.rb
Created March 6, 2014 21:04
ActionController::BadRequest fix for specific locale
module ActionDispatch::Routing::RouteSet::DispatcherFix
def call env
params = env[ActionDispatch::Routing::RouteSet::PARAMETERS_KEY]
params.each do |key,value|
next unless value.respond_to? :valid_encoding?
next if value.valid_encoding?
russian = value.force_encoding 'cp1251'
params[key] = if russian.valid_encoding?
russian.encode 'utf-8'
@morr
morr / cacher.rb
Last active August 29, 2015 13:57
module Cacher
def self.prepended target
target.send :define_singleton_method, :cache do |method|
Cacher.send :define_method, method do |*args|
instance_variable_get("@#{method}") || instance_variable_set("@#{method}", super(*args))
end
end
end
end