DEVGET.NET Blog

DMZ/HotLAN Traffic to LAN 0

DMZ/HotLAN Traffic to LAN

What we are essentially going to do here is to punch a hole through our proxy using iptables

The basic syntax for letting an entire DMZ network use a particular port on LAN is as follows..

iptables -I FORWARD -s DMZNetwork/24 -d LANNetwork/24 -p tcp --dport 80 -j ACCEPT

This will let the DMZ network communicate to the LAN network but only via port 80 (in the case where you have an internal server or multiple internal servers you wish everyone to access).

To let only one ip through (for instance if you want your mail server to authenticate with an active directory or ldap/ldaps server

iptables -I FORWARD -s 192.168.1.1 -d 10.0.10.1 -p tcp --dport 636 -j ACCEPT

Where 192.168.1.1 is the machine on the hotlan/dmz and 10.0.10.1 is our Active Directory/Ldaps server..

Note: the above example is set for ldaps, if you prefer use ldap (unencrypted, not recommended) change to port 389

Installing Django 1.5.1 with python 2.7.4 on Bluehost 3

Installing Django 1.5.1 with python 2.7.4 on Bluehost

First SSH Into your account (using putty, or terminal if you are on linux) where we will start by moving to our home directory (~) and creating a directory for the latest python.

cd ~
mkdir python27
wget http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tgz
tar xzvf Python-2.7.4.tgz
cd Python-2.7.4
./configure -prefix=/homeX/your_username/python27 --enable-unicode=ucs4
make
make install

We then add this python directory to our PATH environment variable and load it (more…)

How to reset mysql password 0

How to reset mysql password

If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:
$ mysqladmin -u root password NEWPASSWORD
However, if you want to change (or update) a root password, then you need to use the following command:
$ mysqladmin -u root -p'oldpassword' password newpass
For example, If the old password is abc, you can set the new password to 123456, enter:

$ mysqladmin -u root -p'abc' password '123456'

Change MySQL password for other users

To change a normal user password you need to type (let us assume you would like to change password for user vivek) the following command:
$ mysqladmin -u vivek -p oldpassword password newpass

Changing MySQL root user password using MySQL sql command

This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:

1) Login to mysql server, type the following command at shell prompt:
$ mysql -u root -p

2) Use mysql database (type command at mysql> prompt):

mysql> use mysql;

3) Change password for user vivek, enter:

mysql> update user set password=PASSWORD("NEWPASSWORD") where User='vivek';

4) Finally, reload the privileges:

mysql> flush privileges;
mysql> quit

The last method can be used with PHP, Python or Perl scripting mysql API.

Appending to column of csv file 0

Appending to column of csv file

## python 2.7.3
import csv
writer=csv.writer(open("output.csv","wb"), delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL)
with open('products.csv', 'rb') as csvfile:
    spamreader = csv.reader(csvfile, delimiter='@')
##    for row in spamreader:
##        writer.writerow(row[0].strip() + row[1].strip() + row[2].strip() +row[3].strip() +row[4].strip() +row[5].strip() + row[6].strip() + row[7].strip() + row[8].strip() + row[9].strip())
    x = 0
    for row in spamreader:
        x = x  + 1
        if (x % 100) == 0:
            writer=csv.writer(open("output"+str(x)+".csv","wb"), delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL)
        if row[9] != "":
            temp = row[9]
            row[9] = 'content_to_append' + temp
        writer.writerow(row)
How to append and pop values in MySql 1

How to append and pop values in MySql


MySQL SUBSTRING() returns a specified number of characters from a particular position of a given string.

Syntax

SUBSTRING(str, pos, len)

OR

SUBSTRING(str FROM pos FOR len).. eg
UPDATE `lockers` SET `currpass` = SUBSTRING(`currpass`, 1, 8)

this would cut down the string in table currpass to only its first 8 characters

to strip off only last 2 characters

UPDATE `joo_categories` SET `title` = SUBSTRING(`title`, 1, CHAR_LENGTH(title) - 2) WHERE  `title` LIKE  '%∞%'
MySQL CONCAT()
Eg.
UPDATE messages SET message = CONCAT(message,'new text to add')where user_id =1;
OR
UPDATE `rqktr_content` SET `title` = SUBSTRING(`title`, 22) where `title` LIKE 'Watch Naruto Shippuden Episode ___'

If there is a chance that the field may contain a null value, the following works:

UPDATE tb_messages 
SET message =CASE 
WHEN LENGTH(message)>0THEN 
                  CONCAT(message,',','New message content')  
ELSE'New message content' 
END
WHERE user_id =1

or

UPDATE `rqktr_content` 
SET `title` = CONCAT('Watch ', title) 
WHERE `title` LIKE 'Fairy Tail Episode ___'

ORRR

UPDATE `rqktr_content` 
SET `title` = CONCAT('Watch Naruto Shippuude', title) 
WHERE `title` LIKE 'n Episode ___'

 

Hope it helps 🙂
refs:http://www.w3resource.com/
http://stackoverflow.com/questions/9548097/does-mysql-offer-append-content-to-the-value-of-a-column

 

0

Activating Windows 8 With no Crack/Patch

First of all you will open your command prompt as administrator by pressing the windows key and X key together
Now type exactly what you see below (Press enter after each line)
slmgr /upk
slmgr /ipk NG4HW-VH26C-733KW-K6F98-J8CK4
slmgr /skms whwebsolution.no-ip.org:80
slmgr.vbs -ato
Have you completed writing the above command? If you’re done, restart your pc and voila, you have successfully activated your windows 8 to be fully genuine. Now enjoy your activated windows 8 and be limited no more…
How to remove ID from URL in Joomla 2.5 and 3 0

How to remove ID from URL in Joomla 2.5 and 3

Open componentscom_contentrouter.php in an editor and make a small changes:
in function ContentBuildRoute(&$query) replace line 27
$advanced    = $params->get('sef_advanced_link', 0);

with

$advanced    = $params->get('sef_advanced_link', 1);
in function ContentParseRoute($segments) replace line 208
$advanced    = $params->get('sef_advanced_link', 0);

with

$advanced    = $params->get('sef_advanced_link', 1);
Comment out lines 228-232
if (strpos($segments[0], ':') === false) {

    $vars['view'] = 'article';

    $vars['id'] = (int)$segments[0];

    return $vars;

}

 

so it would be
/*

if (strpos($segments[0], ':') === false) {

    $vars['view'] = 'article';

    $vars['id'] = (int)$segments[0];

    return $vars;

}*/

 

Façade’s Cabal Bot *SOURCE CODE* 6

Façade’s Cabal Bot *SOURCE CODE*

For those who requested the source code here you go. Would greatly appreciate it if you leave the credits and name as is 🙂 Thank you.

 

If you have any questions and/or recommendations, please leave in the comment section below. (Improvements welcome)

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1
Author:         Façade

Script Function:
Cabal PixelBot.

#ce ----------------------------------------------------------------------------
#include 
#include 
#include 
#include 
#include

 ; Set a HotKey
 HotKeySet("{F3}", "_Interrupt_HotKey") ;F3 to stop
 HotKeySet("{F4}", "CloseBot") ;F4 to quit

 ; Declare a flag
 $fInterrupt = 0

$dll = DllOpen("user32.dll")

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$mainwindow = GUICreate("Façade's Cabal Bot", 350, 400) ;Create Window
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseBot")
GUISetFont(10, 700)

#cs ----------------------------------------------------------------------------
INTERFACE
#ce ----------------------------------------------------------------------------

#cs ------------------------
MENU
#ce ------------------------

$filemenu = GUICtrlCreateMenu("&File")
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
GUICtrlSetOnEvent($exititem, "StopBot")

$helpmenu = GUICtrlCreateMenu("?")
$aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
GUICtrlSetOnEvent($aboutitem, "aboutmenu")

#cs ------------------------
LABELS, BUTTONS AND INPUT DEVICES
#ce ------------------------

; general interface
GUICtrlCreateLabel("xTop", 8, 10)
$xTop = GUICtrlCreateInput("", 44, 8, 100)
GUICtrlCreateLabel("yTop", 8, 42)
$yTop = GUICtrlCreateInput("", 44, 40, 100)
$SetVirtBoxTop = GUICtrlCreateButton("Set Top", 5, 74, 150)
GUICtrlSetOnEvent($SetVirtBoxTop, "SetTop")

GUICtrlCreateLabel("xBot", 170, 10)
$xBot = GUICtrlCreateInput("", 206, 8, 100)
GUICtrlCreateLabel("yBot", 170, 42)
$yBot = GUICtrlCreateInput("", 206, 40, 100)
$SetVirtBoxBot = GUICtrlCreateButton("Set Bottom", 175, 74, 150)
GUICtrlSetOnEvent($SetVirtBoxBot, "SetBot")

GUICtrlCreateLabel("Hp", 8, 120)
$xHpPos = GUICtrlCreateInput("", 30, 116, 50)
$yHpPos = GUICtrlCreateInput("", 82, 116, 50)
$HpColor = GUICtrlCreateInput("", 134, 116, 80)
$HpColorPreview = GUICtrlCreateInput("", 220, 116, 25)
$SetHpColor = GUICtrlCreateButton("Set Hp", 250, 113, 80)
GUICtrlSetOnEvent($SetHpColor, "SetHp")

GUICtrlCreateLabel("Reset Mob", 8, 150)
$xMobPos = GUICtrlCreateInput("", 80, 145, 40)
$yMobPos = GUICtrlCreateInput("", 122, 145, 40)
$MobColor = GUICtrlCreateInput("", 164, 145, 60)
$ResetMobPreview = GUICtrlCreateInput("", 230, 145, 25)
$SetMob = GUICtrlCreateButton("Set Point", 260, 143, 80)
GUICtrlSetOnEvent($SetMob, "Set_Mob")

GUICtrlCreateLabel("MOB COLORS", 8, 188)
$doRed = GUICtrlCreateCheckbox("Red", 14, 205, 75)
$doOrange = GUICtrlCreateCheckbox("Orange", 14, 225, 75)
$doYellow = GUICtrlCreateCheckbox("Yellow", 14, 245, 75)

$buffbutton = GUICtrlCreateCheckbox("Auto Buff", 150, 190, 100)

$potbutton = GUICtrlCreateCheckbox("Auto Pot", 150, 220, 100)
GUICtrlSetState($potbutton, $GUI_CHECKED)
GUICtrlSetOnEvent($potbutton, "enable_pot")

$HpAssist = GUICtrlCreateCheckbox("Hp Assist", 250, 220, 100)
GUICtrlSetOnEvent($HpAssist, "hp_assist")

$z_target = GUICtrlCreateCheckbox("Z-Targeting", 150, 250, 100)
GUICtrlSetOnEvent($z_target, "z_target")
GUICtrlSetState($z_target, $GUI_DISABLE)

$stopbutton = GUICtrlCreateButton("Stop Bot", 5, 348, 340)
GUICtrlSetOnEvent($stopbutton, "StopBot")
GUICtrlSetState($stopbutton, $GUI_DISABLE)

$startbutton = GUICtrlCreateButton("Start Bot", 5, 318, 340)
GUICtrlSetOnEvent($startbutton, "StartBot")

;GUISetState(@SW_SHOW) ;show Graphical User Interface

 GUISetState()

#cs ----------------------------------------------------------------------------
IDLETIME!
#ce ----------------------------------------------------------------------------

 ; Intercept Windows command messages with out own handler
 GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")

While 1
Sleep(10)
WEnd

#cs ----------------------------------------------------------------------------
FUNCTIONALITY
#ce ----------------------------------------------------------------------------

Func SetTop()
While 1
If _IsPressed("1", $dll) Then
$coord = MouseGetPos()
$x = $coord[0]
$y = $coord[1]
;MsgBox(0, "Your Values", $x)
GUICtrlSetData($xTop, $x)
GUICtrlSetData($yTop, $y)
ExitLoop
EndIf
WEnd
EndFunc   ;==>SetTop

Func SetBot()
While 1
If _IsPressed("1", $dll) Then
$coord = MouseGetPos()
$x = $coord[0]
$y = $coord[1]
GUICtrlSetData($xBot, $x)
GUICtrlSetData($yBot, $y)
ExitLoop
EndIf
WEnd
EndFunc   ;==>SetBot

Func SetHp()
While 1
If _IsPressed("1", $dll) Then
$coord = MouseGetPos()
$x = $coord[0]
$y = $coord[1]
$getcolor = PixelGetColor($coord[0], $coord[1])
$color = Hex($getcolor, 6)
GUICtrlSetData($xHpPos, $x)
GUICtrlSetData($yHpPos, $y)
$fullcolor = "0x" & $color
GUICtrlSetData($HpColor, $fullcolor)
GUICtrlSetBkColor($HpColorPreview, $getcolor)
ExitLoop
EndIf
WEnd
EndFunc   ;==>SetHp

Func Set_Mob()
While 1
If _IsPressed("1", $dll) Then
$coord = MouseGetPos()
$x = $coord[0]
$y = $coord[1]
$getcolor = PixelGetColor($coord[0], $coord[1])
$mcolor = Hex($getcolor, 6)
GUICtrlSetData($xMobPos, $x)
GUICtrlSetData($yMobPos, $y)
$fullmobcolor = "0x" & $mcolor
GUICtrlSetData($MobColor, $fullmobcolor)
GUICtrlSetBkColor($ResetMobPreview, $getcolor)
ExitLoop
EndIf
WEnd
EndFunc   ;==>Set_Mob

Func enable_pot()
If GUICtrlRead($potbutton) = $GUI_UNCHECKED Then
GUICtrlSetState($HpColor, $GUI_DISABLE)
GUICtrlSetState($xHpPos, $GUI_DISABLE)
GUICtrlSetState($yHpPos, $GUI_DISABLE)
GUICtrlSetState($HpColorPreview, $GUI_DISABLE)
GUICtrlSetState($SetHpColor, $GUI_DISABLE)
GUICtrlSetState($HpAssist, $GUI_DISABLE)

EndIf
If GUICtrlRead($potbutton) = $GUI_CHECKED Then
GUICtrlSetState($HpColor, $GUI_ENABLE)
GUICtrlSetState($xHpPos, $GUI_ENABLE)
GUICtrlSetState($yHpPos, $GUI_ENABLE)
GUICtrlSetState($HpColorPreview, $GUI_ENABLE)
GUICtrlSetState($SetHpColor, $GUI_ENABLE)
GUICtrlSetState($HpAssist, $GUI_ENABLE)
EndIf
EndFunc   ;==>enable_pot

Func hp_assist()
If GUICtrlRead($HpAssist) = $GUI_CHECKED Then
GUICtrlSetState($doRed, $GUI_DISABLE)
GUICtrlSetState($doOrange, $GUI_DISABLE)
GUICtrlSetState($doYellow, $GUI_DISABLE)

EndIf
If GUICtrlRead($HpAssist) = $GUI_UNCHECKED Then
GUICtrlSetState($doRed, $GUI_ENABLE)
GUICtrlSetState($doOrange, $GUI_ENABLE)
GUICtrlSetState($doYellow, $GUI_ENABLE)
EndIf
EndFunc   ;==>enable_pot

Func z_target()
If GUICtrlRead($z_target) = $GUI_CHECKED Then
GUICtrlSetState($doRed, $GUI_DISABLE)
GUICtrlSetState($doRed, $GUI_UNCHECKED)
GUICtrlSetState($doOrange, $GUI_DISABLE)
GUICtrlSetState($doOrange, $GUI_UNCHECKED)
GUICtrlSetState($doYellow, $GUI_DISABLE)
GUICtrlSetState($doYellow, $GUI_UNCHECKED)

EndIf
If GUICtrlRead($z_target) = $GUI_UNCHECKED Then
GUICtrlSetState($doRed, $GUI_ENABLE)
GUICtrlSetState($doOrange, $GUI_ENABLE)
GUICtrlSetState($doYellow, $GUI_ENABLE)
EndIf
EndFunc   ;==>z_target

Func CloseBot()
DllClose($dll)
;  MsgBox(0, "GUI Event", "Exiting...")
Exit
EndFunc   ;==>CloseBot

Func StopBot()
GUICtrlSetState($startbutton, $GUI_ENABLE)
GUICtrlSetState($stopbutton, $GUI_DISABLE)
EndFunc   ;==>StopBot

Func StartBot()

GUICtrlSetState($startbutton, $GUI_DISABLE)
GUICtrlSetState($stopbutton, $GUI_ENABLE)

WinWaitNotActive ( "Façade's Cabal Bot", "", 2)

     ; Make sure the flag is cleared
     $fInterrupt = 0

$xTop1 = GUICtrlRead($xTop)
$yTop1 = GUICtrlRead($yTop)
$xBot1 = GUICtrlRead($xBot)
$yBot1 = GUICtrlRead($yBot)

$MobNameColor = "0xD1DB0A"
$YellowMob = "0xD1DB0A" ;"0xD8D702"
$OrangeMob = "0xD56F00"
$RedMob = "0xD31E18"

$xMyHp = GUICtrlRead($xHpPos)
$yMyHp = GUICtrlRead($yHpPos)
$myHpColor = GUICtrlRead($HpColor)

$xMobHp = GUICtrlRead($xMobPos)
$yMobHp = GUICtrlRead($yMobPos)
$MobHpColor = GUICtrlRead($MobColor)

While 1
If $fInterrupt <> 0 Then
Return
EndIf

$alive = PixelGetColor($xMobHp, $yMobHp)
If $alive = $MobHpColor or GUICtrlRead($HpAssist) = $GUI_CHECKED then

While $alive = $MobHpColor
if GUICtrlRead($HpAssist) = $GUI_UNCHECKED then
Send("1")
sleep(750)
sleep(750)
sleep(750)
sleep(750)

EndIf
$getHp = PixelGetColor($xMyHp, $yMyHp);

If ($getHp <> $myHpColor And GUICtrlRead($potbutton) == $GUI_CHECKED) _
   or ($getHp <> $myHpColor And GUICtrlRead($HpAssist) == $GUI_CHECKED) Then
Sleep(200)
Send("=")
Sleep(100)
EndIf

$alive = PixelGetColor($xMobHp, $yMobHp);

Send("{Space}")
Sleep(200)
Send("{Space}")
Sleep(200)
WEnd

ElseIf $alive <> $MobHpColor Then
Global $n
Global $coord = ""
if not IsArray($coord) and GUICtrlRead($doYellow) = $GUI_CHECKED then
$coord = PixelSearch($xTop1, $yTop1, $xBot1, $yBot1, $YellowMob, 15)
$n = @error
EndIf
if not IsArray($coord) and GUICtrlRead($doRed) = $GUI_CHECKED then
$coord = PixelSearch($xTop1, $yTop1, $xBot1, $yBot1, $RedMob, 15)
$n = @error
EndIf
if not IsArray($coord) and GUICtrlRead($doOrange) = $GUI_CHECKED then
$coord = PixelSearch($xTop1, $yTop1, $xBot1, $yBot1, $OrangeMob, 15)
$n = @error
EndIf

If IsArray($coord)Then
While @error = 0
$rand = Random(25, 35, 1)
$x = $coord[0]
$y = $coord[1] + $rand
MouseClick("left", $x, $y, 1)
$alive = PixelGetColor($xMobHp, $yMobHp)
ExitLoop

If $alive = $MobHpColor Then
ExitLoop
EndIf

;$coord = PixelSearch($xTop,$yTop,$xBot,$yBot,$yellowmob,5)
;    $n = @error
WEnd

ElseIf $n And GUICtrlRead($buffbutton) == $GUI_CHECKED Then
$buff = Random(7, 9, 1)
Send($buff)
;Sleep(1500)
EndIf

EndIf

WEnd
EndFunc   ;==>StartBot

 Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
     ; The Func 2 button was pressed so set the flag
     If BitAND($wParam, 0x0000FFFF) =  $stopbutton Then $fInterrupt = 1
     Return $GUI_RUNDEFMSG
 EndFunc   ;==>_WM_COMMAND

 Func _Interrupt_HotKey()
     ; The HotKey was pressed so set the flag
     $fInterrupt = 2
GUICtrlSetState($startbutton, $GUI_ENABLE)
GUICtrlSetState($stopbutton, $GUI_DISABLE)
 EndFunc

#cs ------------------------
MENU FUNCTIONS
#ce ------------------------

Func aboutmenu()

MsgBox(0, "Façade's Cabal Bot V1.0", "For Updates and Feature Suggestions go to goo.gl/I5opJ")

EndFunc   ;==>aboutmenu