Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Odyno
Odyno / disable-wifi.sh
Created April 13, 2020 13:56
Enable or Disable wifi in relation to eth connections
#!/bin/bash
# get curret datetime
now=$(date)
echo "Start to check connection: $now"
/sbin/ifconfig eth0 | grep -q 'netmask'
# 0 is active, 1 is inactive
eth0Status=$?
@Odyno
Odyno / lid.sh
Created April 13, 2020 11:52
Disable tty screen in occording of lid state
#!/bin/bash
grep -q close /proc/acpi/button/lid/*/state
if [ $? = 0 ]; then
/usr/sbin/vbetool dpms off
fi
grep -q open /proc/acpi/button/lid/*/state
#!/bin/bash
IMAGE_NAME=<IMAGE_NAME>
IMAGE_VER="$(head -1 version.txt)"
BASEPATH=$(pwd)
docker info > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FATAL : Unable to talk to the docker daemon"
@Odyno
Odyno / set-proxy.sh
Created March 4, 2017 11:42
Temporarily set the proxy in linux shell
odyssey@Itaca:/opt/bin/tmp$ cat set-proxy.sh
#!/bin/bash
#
# Copyright 2012 Alessandro Staniscia (email : alessandro@staniscia.net)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation.#
#
# This program is distributed in the hope that it will be useful,
@Odyno
Odyno / config.xml
Last active February 27, 2017 23:25
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!– … –>
<profiles>
<!– … –>
<profile>
<id>staniscia-repository</id>
<repositories>
<repository>
<id>release-staniscia-rep</id>
@Odyno
Odyno / example.php
Last active August 29, 2015 14:06
Create a custom photos presentation from wppa+... retrive photo info
<?php
if (!class_exists("WPPAEF_Element")) :
class WPPAEF_Element {
var $id, //PhotoID
$timestamp, //Photo Time
$owner, //Owner
@Odyno
Odyno / follow_me_tabs_133.php
Last active December 24, 2015 05:59
Wordpress Follow_Me_Tabs plugin patch
<?php
/*
Plugin Name: Follow me Tabs
Plugin URI: http://follow.code4site.com
Description: Plugin for displaying "Follow me Tabs" on different positions on the browser screen
Author: Igor Ivanov
Version: 1.0
Author URI: http://follow.code4site.com
*/