Skip to content

Instantly share code, notes, and snippets.

View arunsingh's full-sized avatar
💭
In Coding

Arun Singh arunsingh

💭
In Coding
View GitHub Profile
@arunsingh
arunsingh / magic_sqr.html
Created November 20, 2019 09:46
magic square
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<title></title>
<style type="text/css">
body {
margin: 30px;
}
.values {
@arunsingh
arunsingh / interviewitems.MD
Created March 21, 2017 21:45 — forked from amaxwell01/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@arunsingh
arunsingh / nvidia_brightness_watcher.py
Created August 31, 2016 13:21 — forked from mmueller/nvidia_brightness_watcher.py
This is an ugly-ass hack to temporarily fix a brightness jumping problem with some nvidia-based laptops on Linux, until nvidiabl/nvidia drivers fix the issue. Watches the actual brightness of the display, and when it jumps up past the maximum, resets it to the original desired value.
#!/usr/bin/env python
import os
import time
BACKLIGHT = 'nvidia_backlight'
DELAY = 0.2
def get_value(name):
path = os.path.join('/sys/class/backlight', BACKLIGHT, name)
@arunsingh
arunsingh / bitly.py
Created August 31, 2016 13:20 — forked from mmueller/bitly.py
Command-line bit.ly URL generator (Python)
#!/usr/bin/env python
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@arunsingh
arunsingh / pup_lint.txt
Last active August 17, 2016 15:29
pup_lint error dependency
puppet-lint -f package/manifests/ntp.pp
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
/Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-lint/plugins/check_whitespace.rb:151:in `*': negative argument (ArgumentError)
from /Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-lint/plugins/check_whitespace.rb:151:in `fix'
from /Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-lint/checkplugin.rb:41:in `block in fix_problems'
from /Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-lint/checkplugin.rb:38:in `each'
from /Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-lint/checkplugin.rb:38:in `fix_problems'
from /Users/livestream/.rvm/gems/ruby-1.9.3-p551/gems/puppet-lint-2.0.0/lib/puppet-l
@arunsingh
arunsingh / dep_error.txt
Created August 16, 2016 10:19
dependency_error
debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using pson
debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using pson
debug: Service[rsyslog](provider=debian): Executing '/etc/init.d/rsyslog status'
debug: /Schedule[never]: Skipping device resources because running on a host
debug: Puppet::Type::Package::ProviderApt: Executing '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install openssh-server=1:6.0p1-4+deb7u4'
err: /Stage[main]/Package::Openssh_server_debian_7/Package[openssh-server]/ensure: change from 1:6.0p1-4+deb7u1 to 1:6.0p1-4+deb7u4 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install openssh-server=1:6.0p1-4+deb7u4' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1:6.0p1-4+deb7u4' for 'openssh-server' was not found
at /home/arunsingh/puppet/modules/package/manifests/openssh_server_debian_7.pp:7
@arunsingh
arunsingh / puppet apache log analyzer
Created July 15, 2016 10:04 — forked from jasonhancock/puppet apache log analyzer
Analyze puppet's apache logs.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $file = $ARGV[0] or die('Must pass an apache access logfile');
open IN, "<$file" or die("Can't open $file");
@arunsingh
arunsingh / vagfile
Created June 28, 2016 11:10
/Users/aruns/vagrant_deb_wheezyenv/Vagrantfile
# -*- 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.
##read vm and pupper configs from JSON files
nodes_config = (JSON.parse(File.read("nodes.json")))['nodes']
@arunsingh
arunsingh / vagrant2.log
Created June 28, 2016 05:42
vagrant_2_log Debug mode
INFO global: Vagrant version: 1.8.4
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_SHELL="/bin/bash"
INFO global: VAGRANT_OLD_ENV_OLDPWD="/Users/aruns"
INFO global: VAGRANT_OLD_ENV_LOGNAME="aruns"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color"
INFO global: VAGRANT_OLD_ENV_TMPDIR="/var/folders/nj/xlbwtb9s1y9f4rc09qzpd4200000gp/T/"
INFO global: VAGRANT_OLD_ENV_HOME="/Users/aruns"
@arunsingh
arunsingh / vagrant log
Created June 27, 2016 12:15
Vagrant up --debug output
INFO global: Vagrant version: 1.8.4
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_TMPDIR="/var/folders/nj/xlbwtb9s1y9f4rc09qzpd4200000gp/T/"
INFO global: VAGRANT_OLD_ENV_OLDPWD="/Users/aruns"
INFO global: VAGRANT_OLD_ENV_ITERM_PROFILE="Default"
INFO global: VAGRANT_OLD_ENV_ITERM_SESSION_ID="w0t0p1"
INFO global: VAGRANT_OLD_ENV_LC_CTYPE="UTF-8"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_OLD_ENV_XPC_FLAGS="0x0"