Skip to content

Instantly share code, notes, and snippets.

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

Rustam linuxoid69

🏠
Working from home
View GitHub Profile
@linuxoid69
linuxoid69 / Vagrantfile
Last active October 27, 2015 12:10
vagrant-test
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@linuxoid69
linuxoid69 / groovy xml parser
Last active October 21, 2015 13:31
groovy xml parser
task parseXml() {
def fileXml = new File('xmlexample.xml')
def resources = new XmlSlurper().parseText(fileXml.getText())
if (resources.string[0].@name == 'host'){
resources.string[0]= 'localhost'
}
def f = XmlUtil.serialize(resources)
def of = new File('xmlexample2.xml')
@linuxoid69
linuxoid69 / jabber_cli
Created July 16, 2015 14:48
jabber cli
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import xmpp,sys
xmpp_jid = 'noreply@some.jabber.server'
xmpp_pwd = 'noreplypass'
to = sys.argv[1]
msg = sys.argv[2]
@linuxoid69
linuxoid69 / color
Last active February 6, 2024 16:56
man color gentoo
# красно-зеленая
export LESS_TERMCAP_mb=$'\033[01;31m'
export LESS_TERMCAP_md=$'\033[01;31m'
export LESS_TERMCAP_me=$'\033[0m'
export LESS_TERMCAP_se=$'\033[0m'
export LESS_TERMCAP_so=$'\033[01;44;33m'
export LESS_TERMCAP_ue=$'\033[0m'
export LESS_TERMCAP_us=$'\033[01;32m'
export LESS=-r
export GROFF_NO_SGR=1
@linuxoid69
linuxoid69 / switch_layout.sh
Created June 9, 2015 15:37
keyboard layout
#!/bin/bash
CURRENT=$(setxkbmap -query | grep layout | awk '{print $2}')
if [[ $CURRENT == 'ru' ]]
then
setxkbmap us
else
setxkbmap ru
fi
server {
listen 80;
server_name example.com;
root '/var/www/example.com/htdocs';
location / {
root '/var/www/example.com/htdocs';
index index.php;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;