Skip to content

Instantly share code, notes, and snippets.

View kramarama's full-sized avatar
sand of time

Vladimir K kramarama

sand of time
View GitHub Profile
@kramarama
kramarama / php.php
Last active August 29, 2015 13:57
php
$ php -r 'echo date("r");'
Mon, 27 Oct 2014 14:15:48 +0300
//---------------------------------------------------------
<?php
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
ini_set('log_errors',TRUE);
ini_set('html_errors',FALSE);
ini_set('error_log','php.log');
@kramarama
kramarama / xdebug
Created March 21, 2014 19:58
install xdebug on centos
http://xdebug.org/install.php#configure-php
http://blog.jetbrains.com/phpstorm/2013/08/debugger-configuration-validation-with-phpstorm/
on CentOS:
1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
yum install php-pear
2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake
@kramarama
kramarama / centos
Created March 21, 2014 19:59
centos fresh install
yum update
yum upgrade
tzselect
yum groupinstall "Web Server"
yum groupinstall "MySQL Database Server"
yum groupinstall "PHP Support"
service mysqld start
mysql_secure_installation
service httpd start
chkconfig httpd on
@kramarama
kramarama / boot
Last active August 29, 2015 13:57
backup /boot partition
# backup /boot
dd if=/dev/sda1 conv=sync,noerror bs=1024K | gzip -c > /media/db471742-b20a-cf01-d047-1342b20acf01/boot.sda1.img.gz
# backup /
dd if=/dev/sda2 conv=sync,noerror bs=1024K | gzip -c > /media/db471742-b20a-cf01-d047-1342b20acf01/root.sda2.img.gz
# backup /var
dd if=/dev/sdb6 conv=sync,noerror bs=1024K | gzip -c > /media/db471742-b20a-cf01-d047-1342b20acf01/var.sdb6.img.gz
####################
@kramarama
kramarama / selinux
Created March 21, 2014 20:02
selinux centos
sestatus
sestatus -b | grep sendmail
setsebool httpd_can_sendmail=1
setsebool httpd_can_network_connect=1
ls -lZ /etc/httpd
ls -dZ /var/www/domain
chcon -Rv --type=httpd_sys_content_t /var/www/domain
@kramarama
kramarama / windows
Created March 21, 2014 20:04
windows stuff
Enable dotnet3.5:
Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs /LimitAccess
Boot into safe mode:
msconfig.exe
Restore MBR:
bootrec.exe /fixmbr
@kramarama
kramarama / move var
Created March 21, 2014 20:05
move /var to separate partition
1) mkdir /newvar
2) mount /dev/md40 /newvar
3) cp -Rax /var /newvar
4) mv /var /oldvar
5) change fstab to mount /var to /dev/md40
fix security labels after move:
$ restorecon /var
@kramarama
kramarama / grub2
Created March 21, 2014 20:06
grub2 problems
set prefix=(hd0,1)/boot/grub2
insmod (hd0,1)/boot/grub2/i386-pc/linux.mod
set root=(hd0,1)
linux /vmlinuz-nrj-desktop root=/dev/sda2
initrd /initrd-nrj-desktop.img
boot
@kramarama
kramarama / relocate.xml
Created March 21, 2014 20:07
relocate Users folder windows 8
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FolderLocations>
<ProfilesDirectory>d:\Users</ProfilesDirectory>
</FolderLocations>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:F:/sources/install.wim#Windows 8 PRO" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
@kramarama
kramarama / SSD-linux
Created March 21, 2014 20:12
SSD setup linux
# what's up in there:
cat /sys/block/sda/queue/scheduler
cat /sys/block/sda/queue/iosched/fifo_batch
# FileSys MountPt Type Options Dump Pass
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=15% 0 0
tmpfs /var/tmp tmpfs defaults,size=5% 0 0
tmpfs /var/log tmpfs defaults,size=5% 0 0
# modes: