Skip to content

Instantly share code, notes, and snippets.

View AlexKMDev's full-sized avatar

Alex AlexKMDev

View GitHub Profile
@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]
@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
/* 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 / 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)$ {
@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 / some_spaghetti_code.js
Last active December 17, 2015 10:49
country list with codes in russian from http://www.artlebedev.ru/tools/country-list/
'AB' => 'Абхазия',
'AU' => 'Австралия',
'AT' => 'Австрия',
'AZ' => 'Азербайджан',
'AL' => 'Албания',
'DZ' => 'Алжир',
'AS' => 'Американское Самоа',
'AI' => 'Ангилья',
'AO' => 'Ангола',
'AD' => 'Андорра',
@AlexKMDev
AlexKMDev / backup.sh
Last active August 29, 2015 13:57
reinstall homebrew packages
#!/bin/sh
BACKUP_PATH=/tmp/packages_list
brew ls > $BACKUP_PATH
brew rm $(cat $BACKUP_PATH)
brew install $(cat $BACKUP_PATH)
rm $BACKUP_PATH
brew cleanup -s
@AlexKMDev
AlexKMDev / rename.sh
Created March 6, 2014 17:20
add newline to list of files
#!/bin/sh
for file in $(cat list.txt); do sed -i '' -e '$a\' $file; done
@AlexKMDev
AlexKMDev / Brewfile
Last active August 29, 2015 13:57
System Brewfile
update
upgrade
# beautiful info about system
install archey
# ssh connection with monitoring and autoreconnecting
install autossh
# brew repo for desktop apps
@AlexKMDev
AlexKMDev / install_osx.sh
Last active August 29, 2015 14:01
caesaria install script for OS X
#!/bin/sh
LIBDIR=~/Library/Frameworks/
mkdir caesaria
pushd caesaria
curl -C - -OL http://downloads.sourceforge.net/project/opencaesar3/bin/caesaria-mac-b1362.zip
unzip caesaria-mac-b1362.zip