Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

  • Canada
View GitHub Profile
@anytizer
anytizer / users-login.sh
Created October 12, 2013 09:25
List of users who can login into the system
cat /etc/passwd | grep -v nologin
@anytizer
anytizer / mysql-database-triggers.sql
Created October 12, 2013 14:52
List of triggers in a MySQL database
SELECT
EVENT_MANIPULATION,
ACTION_TIMING,
TRIGGER_NAME,
ACTION_STATEMENT
FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA = 'database';
@anytizer
anytizer / social-media.csv
Created October 16, 2013 10:02
List of selected social media where one should promote the websites
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Bing
Bitbucket
DMOZ
Dropbox
Facebook Profile and Pages
Feed Burner
GitHub
Google Code
Google Local Business
Google Plus Profile and Pages
@anytizer
anytizer / mysql-function-currency-random.sql
Created October 19, 2013 12:12
Simple mysql function in 3 steps
DROP FUNCTION IF EXISTS f_currency;
DELIMITER $$
CREATE FUNCTION f_currency()
RETURNS FLOAT(8,2)
BEGIN
RETURN ROUND(RAND()*100, 2);
END $$
SELECT f_currency();
@anytizer
anytizer / crontab-all-usrs.sh
Created October 19, 2013 14:28
List out cron jobs for all users
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
Details:
http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users
http://www.linux-faqs.info/bash/list-all-cron-jobs-for-all-users
<?php
/**
* Controlled way of handling parameter names.
* The script cannot add or read new parameters dynamically.
*/
abstract class FixedParameters
{
/**
* Does not allow the script to modify set of parameters later on.
*/
@anytizer
anytizer / gist:7264853
Created November 1, 2013 12:40
json pretty print
/**
* If JSON_PRETTY_PRINT was NOT defined on the server, set to to false (unactivated)
*/
if(!defined('JSON_PRETTY_PRINT')) define('JSON_PRETTY_PRINT', false);
function json_encode_custom($array=array())
{
if(JSON_PRETTY_PRINT)
{
return json_encode($array, JSON_PRETTY_PRINT);
}
@anytizer
anytizer / gist:7278466
Created November 2, 2013 12:34
Recent modified files on the linux server
find . -type f -mtime -2 | grep -v svn
@anytizer
anytizer / gist:7291019
Last active April 22, 2020 11:35
msn blocklist
https://kb.leaseweb.com/display/KB/Procedure+to+remove+blacklist
http://www.pinpointe.com/blog/how-do-i-know-if-im-on-a-spam-blacklist
Procedure to remove blacklist
https://kb.leaseweb.com/display/KB/Procedure+to+remove+blacklist
@anytizer
anytizer / error-logs.sh
Created November 6, 2013 08:21
Find php error logs in htdocs area
find /home/htdocs -type f -name 'error_log'