For gathering all wireless info

Posted on Updated on

The easiest and most complete method of gathering information to help diagnose wireless issues is to run the wireless info script to collect all the most common information needed while masking all sensitive data.

wget https://raw.githubusercontent.com/SinghSatyam/HelperScripts/master/wireless_info_script.sh && chmod +x wireless_info_script.sh && ./wireless_info_script.sh

This will create the file “wireless-info.txt” at the location it is run from, and depending on its size, an additional archive called “wireless-info.tar.gz”. Sensitive information like MAC addresses and WPA/WEP keys are masked automatically.

If you cannot connect to the internet with the affected system, including via a wired connection, you will have to move files between it and a system connected to the internet. A USB stick would likely be the easiest method for this.

Advertisements

Installing LAMP on CENTOS

Posted on

sudo yum install httpd
sudo service httpd start
sudo yum install mysql-server
sudo service mysqld start
sudo /usr/bin/mysql_secure_installation
sudo yum install php php-mysql

sudo yum install php-bcmath.x86_64 php-cli.x86_64 php-common.x86_64 php-dba.x86_64 php-devel.x86_64 php-embedded.x86_64 php-enchant.x86_64 php-fpm.x86_64 php-gd.x86_64 php-imap.x86_64 php-intl.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mysql.x86_64 php-odbc.x86_64 php-pdo.x86_64 php-pear.noarch php-pecl-apc.x86_64 php-pecl-apc-devel.i686 php-pecl-apc-devel.x86_64 php-pecl-memcache.x86_64 php-snmp.x86_64 php-soap.x86_64 php-tidy.x86_64 php-xml.x86_64 php-xmlrpc.x86_64 php-zts.x86_64

sudo chkconfig httpd on
sudo chkconfig mysqld on
sudo service httpd restart

Fix in ruby 2.2.x for Warning: Circular Argument Reference

Posted on Updated on

—————Change this in activerecord/lib/active_record/associations/has_many_association.rb—————————

– def has_cached_counter?(reflection = reflection)
+ def has_cached_counter?(reflection = reflection())
owner.attribute_present?(cached_counter_attribute_name(reflection))
end


– def cached_counter_attribute_name(reflection = reflection)
+ def cached_counter_attribute_name(reflection = reflection())
“#{reflection.name}_count”
end


– def update_counter(difference, reflection = reflection)
+ def update_counter(difference, reflection = reflection())
if has_cached_counter?(reflection)
counter = cached_counter_attribute_name(reflection)
owner.class.update_counters(owner.id, counter => difference)


– def inverse_updates_counter_cache?(reflection = reflection)
+ def inverse_updates_counter_cache?(reflection = reflection())
counter_name = cached_counter_attribute_name(reflection)
reflection.klass.reflect_on_all_associations(:belongs_to).any? { |inverse_reflection|
inverse_reflection.counter_cache_column == counter_name

—————————————————————————————————————————————————

—————————–Change this in activesupport/lib/active_support/values/time_zone.rb—————————

– def parse(str, now=now)

+ def parse(str, now=now())
parts = Date._parse(str, false)
return if parts.empty?

 

#This’ll also fix this issue in ruby which you’ll have no idea of its origin:
#NoMethodError: undefined method `year’ for nil:NilClass

—————————————————————————————————————————————————-

Rename All Files In Folder To Numbered List

Posted on

ls *.jpg | cat -n | while read n f; do mv "$f" "file-$n.jpg"; done

ls lists the files in the current directory and cat -n adds line numbers. The while loop reads the resulting numbered list of files line by line, stores the line number in the variable n and the filename in the variable f and performs the rename.

Zero Caching With Apache

Posted on Updated on

Putting this in .htaccess, httpd.conf and in a VirtualHost (usually placed in httpd-vhosts.conf should stop apache caching any page on the client side.

<filesMatch "\.(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>

Installing npm and NodeJs on Ubuntu

Posted on

First of all let’s remove the npm and nodejs that comes by default with the OS
sudo apt-get purge nodejs npm
sudo apt-get update

Once you are done, install the dependency softwares by :
sudo apt-get install -y python-software-properties

Add the new repository for NodeJS and NPM by :
sudo add-apt-repository ppa:chris-lea/node.js

Once done, update your local package list by:
sudo apt-get update

Finally you can install NodeJS and NPM using a single command:
sudo apt-get install nodejs

The above command will install both NodeJS and NPM as well. There is no need to separately install npm package.

Basic softwares for CentOS/RHEL/Fedora

Posted on Updated on

These are the basic softwares to install just after you have installed CentOS/RHEL/Fedora:
sudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel vim wget git-core

Enable EPEL[(Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux.]:

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# rpm -ivh epel-release-7-5.noarch.rpm
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm