▁where ▁he ▁shortly ▁was ▁appointed ▁as ▁the ▁fis cal ▁administrator ▁of ▁the ▁Gh az nav id ▁capital ▁of ▁Gh az ni ▁and ▁India . ▁In ▁ 1 0 3 0 , ▁Mah m ud ▁died ▁and ▁was ▁succeeded ▁by ▁his ▁son ▁Muhammad , ▁who ▁appointed ▁Ham da wi ▁as ▁his ▁viz ier , ▁but ▁was , ▁however , ▁shortly ▁over th rown ▁by ▁his ▁more ▁experienced ▁brother ▁Mas ' ud ▁I , ▁who ▁shortly ▁appointed ▁A hm ad ▁May m and i ▁as ▁his ▁viz ier , ▁while ▁appoint ing ▁Ham da wi ▁as ▁the ▁fis cal ▁administrator ▁of ▁the ▁entire ▁Gh az nav id ▁Empire . ▁ ▁In ▁ 1 0 3 3 , ▁Ham da wi ▁was ▁appointed ▁as ▁the ▁governor ▁of ▁J ib al , ▁which ▁was ▁then ▁held ▁under ▁the ▁control ▁of ▁the ▁K ak uy id ▁r uler ▁Muhammad ▁ibn ▁R ust am ▁D ush man zi yar , ▁who ▁was ▁a ▁v ass al ▁of ▁the ▁Gh az nav ids . ▁However , ▁Muhammad ▁kept ▁reb elling ▁against ▁Mas ' ud ▁I , ▁and ▁Ham da wi ▁was ▁shortly ▁sent ▁to ▁deal ▁with ▁the ▁latter , ▁which ▁he ▁managed ▁to ▁accomplish . ▁During ▁the ▁same ▁period , ▁Ham da wi ▁had ▁to ▁protect ▁J ib al ▁from ▁mar aud ing ▁O gh uz ▁Tur ks ▁who ▁had ▁arrived ▁in ▁the ▁region ▁from ▁their ▁ste pp es ▁north ▁to ▁Kh war az m . ▁Ham da wi ▁managed ▁to ▁defeat ▁the ▁Tur ks , ▁and ▁then ▁had ▁their