Skip to content

Instantly share code, notes, and snippets.

View AmitChotaliya's full-sized avatar

Amit Chotaliya AmitChotaliya

View GitHub Profile

This utility is to flatten deeply nested dictionary/lists to list of unique keys with a separator.

Note: This only returns keys and not values.

Code Is as below:

from collections.abc import MutableMapping
@AmitChotaliya
AmitChotaliya / pysyslog.py
Created October 9, 2020 13:40 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
#!/bin/bash
# copyright Amit Chotaliya
# GNU GPL
# http://www.gnu.org/licenses/gpl.html
# ------------------------------------------------------------------------
USAGE=" Usage: nth_weekday_of_month [ --help | 1 | 2 | 3 | 4 | 5 ] PROGRAM"

There are two ways we do this.

  • We have VPN access so anything can only be accessed if one is logged into VPN. We can just remove VPN access for the user and everything will be out of reach.
  • For services like database, FTP we use multiple users and application alos has it's own user so application does not need to be changed if any other access changes. Application user will not used by any person, It is only used by application.

There are multiples configurations available for blocking specific IP or allowing specific IP/range for services. Plesk Firewall(Only Available on Windows) can be used to allow/deny any IP/Range from accessing a specific port. So in this case if we want to allow access to our database(MySQL, MSSQL), FTP and Plesk from a specific IP then we can add the following rules.

Allow IP 1.2.3.4 on

Service Port
Plesk 8443
MySQL 3306
FTP 22
org.apache.solr.common.SolrException: no field name specified in query and no default specified via 'df' param
at org.apache.solr.parser.SolrQueryParserBase.checkNullField(SolrQueryParserBase.java:700)
at org.apache.solr.parser.SolrQueryParserBase.getFieldQuery(SolrQueryParserBase.java:720)
at org.apache.solr.parser.SolrQueryParserBase.handleBareTokenQuery(SolrQueryParserBase.java:541)
at org.apache.solr.parser.QueryParser.Term(QueryParser.java:299)
at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:185)
at org.apache.solr.parser.QueryParser.Query(QueryParser.java:107)
at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:96)
at org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:151)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:50)
@AmitChotaliya
AmitChotaliya / gist:8d983f598dac27c98e5d
Created July 6, 2015 11:01
salt stack gem install bundler not working
I am trying to install bundler but It is failing due to the following error.
ID: install_bundler
Function: gem.installed
Name: bundler
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1563, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/gem.py", line 81, in installed