Skip to content

Instantly share code, notes, and snippets.

View tyagiakhilesh's full-sized avatar

Akhilesh Tyagi tyagiakhilesh

  • Bangalore, India
View GitHub Profile
@tyagiakhilesh
tyagiakhilesh / InstallGUI.md
Last active June 16, 2017 07:54
Cent OS converting a head less machine to full GUI machine

You shall need sudo access for all of these.

You might want to create a new user do as following

useradd <username>
passwd <username>
usermod -aG wheel <username>

Install GUI

// Update the machine first ? I like to do that often. You can skip it.
//This might come handy when you want to inspect the fs of a dead container
//or want to debug why it was not coming alright.
docker container run -it --rm --entrypoint=/bin/bash <image id>
// To transfer images from one host to another
docker save <image id> > /tmp/image.tar
docker load < /tmp/image.tar
@tyagiakhilesh
tyagiakhilesh / mozilla-firefox.desktop
Created January 2, 2018 06:26
Creating shortcut for apps in linux (centos/ubunut)
[Desktop Entry]
Version=1.0
Name=Firefox
Comment=Browse the World Wide Web
Icon=/opt/firefox/browser/icons/mozicon128.png
Exec=/opt/firefox/firefox %u
Terminal=false
Type=Application
Categories=Network;WebBrowser;
Actions=Default;Mozilla;ProfileManager;
@tyagiakhilesh
tyagiakhilesh / vscode.desktop
Created January 3, 2018 11:08
Visual Studio Code desktop file
[Desktop Entry]
Version=1.0
Type=Application
Name=Visual Studio Code
Icon=/opt/VSCode-linux-x64/resources/app/resources/linux/code.png
Exec=/opt/vscode/bin/code
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=visual-studio-code
I tried to do away the task with
```
KILL Request (JSON):
POST /api/v1/scheduler HTTP/1.1
Host: masterhost:5050
Content-Type: application/json
Mesos-Stream-Id: 130ae4e3-6b13-4ef4-baa9-9f2e85c3e9af
{
@tyagiakhilesh
tyagiakhilesh / drop_databases.sql
Created January 12, 2018 06:48
Dropping multiple databases in mssql
use master
go
declare @dbnames nvarchar(max)
declare @statement nvarchar(max)
set @dbnames = ''
set @statement = ''
select @dbnames = @dbnames + ',[' + name + ']' from sys.databases where name like 'datbase_name_%'
if len(@dbnames) = 0
begin
print 'no databases to drop'
@tyagiakhilesh
tyagiakhilesh / postgres.sql
Last active January 26, 2018 07:33
Postgres maintainance queries
-- Finding open connections
SELECT * FROM pg_stat_activity;
-- Dropping open connections
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = <databasename> AND pid <> pg_backend_pid() AND state in ( 'idle');
-- Describing a table
select column_name, data_type, character_maximum_length from INFORMATION_SCHEMA.COLUMNS where table_name = 'pg_stat_activity';
@tyagiakhilesh
tyagiakhilesh / set-proxy.cmd
Created January 18, 2018 09:02
Setting up proxy for npm
$ npm config set proxy http://<username>:<password>@<proxy-server-url>:<port>
$ npm config set https-proxy http://<username>:<password>@<proxy-server-url>:<port>
@tyagiakhilesh
tyagiakhilesh / README.md
Created February 7, 2018 07:19 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@tyagiakhilesh
tyagiakhilesh / maven-and-dependencies.md
Last active February 22, 2018 11:39
Guns for winning maven dependencies war...

You need to know about:

mvn dependency:tree
mvn dependency:analyze