Skip to content

Instantly share code, notes, and snippets.

View AlexKMDev's full-sized avatar

Alex AlexKMDev

View GitHub Profile
@AlexKMDev
AlexKMDev / gist:5589909
Last active December 17, 2015 09:48
restore packages installed from pacman in new copy of Arch Linux
1. comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist.txt
2. pacman -S $(< pkglist.txt)
@AlexKMDev
AlexKMDev / gist:5577688
Last active December 17, 2015 08:08
base nginx configuration for php-fpm
server {
listen 80;
server_name anakros.name;
location / {
root /srv/http/main;
index index.html index.php;
}
location ~ \.(php|html|htm)$ {
/* Large desktop */
@media (min-width: 1200px) { }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { }
/* Landscape phone to portrait tablet */
@media (max-width: 767px) { }
/* Landscape phones and down */
@AlexKMDev
AlexKMDev / bash
Created March 28, 2013 08:13
start internal mac os x vnc server with right preferences
first way :
1. Enable "VNC viewers may control screen" option in remote management preferences.
second way (via ssh)
1. start server with sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw [your_password] -restart -agent -privs -all
2. if server already started, stop it with sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
@AlexKMDev
AlexKMDev / bash
Last active December 14, 2015 16:38
Change hostname on Mac OS X 10.8.2 > [hostname]:~ [username]$
sudo scutil --set HostName [hostname]