Skip to content

Instantly share code, notes, and snippets.

View sandheepg's full-sized avatar

Sandeep Guduru sandheepg

View GitHub Profile
@sandheepg
sandheepg / gmail-hack.md
Last active March 8, 2017 04:32
Gmail hack

The below hack might come in handy for testing when a unique account is required.

You can throw '.'s into gmail email addresses and they all end up at the same address on gmail.

See the example below

All the below email addresses end up as same.
[email protected]
[email protected]
@sandheepg
sandheepg / hashed-password.md
Last active March 8, 2017 05:15
Generate Hashed password

To generate SHA-1 cryptographic hash of a password text

echo -n "some password" | openssl sha1
# for mac
echo -n "some password" | shasum -a 1 | awk '{print $1}’ # SHA1 hash
echo -n "some password" | shasum -a 256 | awk '{print $1}’ # SHA256 hash
# for linux
echo -n "some password" | sha1sum | awk '{print $1}’ # SHA1 hash
echo -n "some password" | sha1sum | awk '{print toupper($1)}' # for upcase
@sandheepg
sandheepg / incognito-caching.md
Created March 8, 2017 05:18
Caching in incognito mode

I've noticed that Incognito mode retain cache from the previous browser session, it just don't collect any new cache while in incognito.

I usually clear the cache/cookies then go into incognito, or run a different browser profile, or a different browser all together.

This works for me well !!

@sandheepg
sandheepg / adobe-chrome.md
Created March 8, 2017 05:22
Adobe flash player installation in chrome browser

For Chromium browser versions greater than 34, to use flash one must install Pepper flash.

For Ubuntu 14.04 or newer, run

sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --status 
# to see what version of Pepper Flash you have installed.
sudo update-pepperflashplugin-nonfree --install
# If there is a newer version available
@sandheepg
sandheepg / adobe-flash-ubuntu.md
Created March 8, 2017 05:24
Adobe flash player installation in Ubuntu

This is to install adobe flash player in Ubuntu 14.04 or higher. This works for Firefox browser.

If you have a 32-bit OS, run

sudo apt-get update
sudo apt-get install flashplugin-installer

Make sure each of the commands executed successfully.

@sandheepg
sandheepg / copy-remote-local.md
Created March 8, 2017 05:27
Copy remote folder to local machine

To copy a folder in the remote server to your local machine,

scp -r username@IPaddres:/remote/directory/path /local/folder/

In case you wish to copy in your current local directory

scp -r username@IPaddres:/remote/directory/path/ .
@sandheepg
sandheepg / rails-construct-finder-sql.md
Last active March 8, 2017 08:09
Retrieve SQL query in Rails 2.x

The method is construct_finder_sql(options) (lib/active_record/base.rb:1681) You will have to use send because it is private.

sql = Item.send :construct_finder_sql, :select => :all, :include => [:categories, :prices], :conditions => conditions

sql = ActionType.send :construct_finder_sql, :select => 'hosted, top_action_type, count(*) as count', :group => 'hosted, top_action_type'
@sandheepg
sandheepg / resolve-conf-issue.md
Last active March 8, 2017 05:48
Not a symbolic link resolve.conf

/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf

If you encounter the above issue, use following command and answer YES to enable dynamic updates:

sudo dpkg-reconfigure resolvconf

Do a system restart after that.

@sandheepg
sandheepg / sublime-package-setup.md
Created March 8, 2017 05:47
Unable to run package setup for sublime text

I've encountered the following error after installing Sublimetext2 from source on my ubuntu machine. The error says

unable to run package setup with list of packages

in a dialog box when sublime text is opened.

The issue is because of missing permissions and to resolve the issue, run the below command.

sudo chown -R user-name /home/user-name/.config/sublime-text-2/
@sandheepg
sandheepg / sudo-not-working.md
Created March 8, 2017 05:49
sudo not working

sudo: /etc/sudoers is mode 0640, should be 0440?

When a similar message appears when you try to run sudo on your machine, the problem is likely with the permissions of /etc/sudoers file.

Try running

pkexec chmod 0440 /etc/sudoers