title: troff to PDF conversion

text: I am very new to **`UNIX`** and trying to learn **`troff`**. I have some set of very old written **`troff`** files (before 20 years from now). Some samples are hereunder: _**`file_00.g`_**               B,4.5,3.5,15.5,23.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0          P     B,4.5,3.5,15.5,23.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     P          B,4.5,3.5,15.5,24.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     ~GET12B     H,9.25,26.0, -i-     ~GET12B     H,13.0,2.3,Grasping the Wind     D,13.0,2.4,16.7,2.4     D,13.0,2.5,16.7,2.5     P          B,4.5,3.5,15.5,24.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     ~GET12B     H,9.25,26.0, -ii-     ~GET12B     H,3.5,2.3,Grasping the Wind     D,3.5,2.4,7.25,2.4     D,3.5,2.5,7.25,2.5     P          B,4.5,3.5,15.5,23.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     ~GET12B     H,9.25,26.0, -iii-     ~GET12B     H,13.0,2.3,Grasping the Wind     D,13.0,2.4,16.7,2.4     D,13.0,2.5,16.7,2.5     P          B,4.5,3.5,15.5,23.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     ~GET12B     H,9.25,26.0, -iv-     ~GET12B     H,3.5,2.3,Grasping the Wind     D,3.5,2.4,7.25,2.4     D,3.5,2.5,7.25,2.5     P          B,4.5,3.5,15.5,23.5     D,1.3,1.25,1.5,1.25     D,1.5,1.0,1.5,1.25     D,18.5,1.25,18.8,1.25     D,18.5,1.0,18.5,1.25     D,1.3,26.75,1.5,26.75     D,1.5,26.75,1.5,27.0     D,18.5,26.75,18.8,26.75     D,18.5,26.75,18.5,27.0     ~GET12B     H,9.25,26.0, -v-     ~GET12B     H,13.0,2.3,Grasping the Wind     D,13.0,2.4,16.7,2.4     D,13.0,2.5,16.7,2.5     P      _**`file_01.ms`_**               #START=     ~F     ~F     ~Gm0,2     #CHE=Preface     ~P0     ~Gm0,0.5     ~P0     #j=``The names of the points are not merely nominal;     each has a profound meaning.''     ~Gm3,0.3     #u=Sun Si Miao     ~Gm0,1.5     ~P0     #P=     ~GERB30 ~E     F     ~GERR12 ~E     ~Gm-0.12,0     or Western students of Chinese acupuncture,     who have only to memorize     a numbered sequence channel by channel, recognition of the significance and     usefulness of the names of the acupuncture points is easy to miss.  In     comparison with what the Chinese student must cope, the Western system is     convenient, logical and easy to learn. Yet alphanumeric codes deprive     Western students of a great advantage, both in possible insights     into Chinese culture and medicine, and in learning about the points themselves.     It is to aid this perceived lack that we set about the task of translating and     compiling.     #P=Readers may note that all the material presented in this text has been drawn     solely from Chinese sources.  The explanations of the point names are those     expressed by Chinese authors, both ancient and modern. Each point name     is presented in Chinese, English translation, alphanumeric code and pinyin.     Alternate names that may be encountered are listed, as are relevant translations     for each character in the point name.     ~GERB12 ~E  Appendix A, The Glossary of Single Characters #r=     provides more extensive character definitions.     #P=Because the point's location, as expressed in the classics, will often shed     light on the name of the point, the classical location is given for each point     name.  This information is largely drawn from the #i= Great Compendium of     Acupuncture,#r= except where other sources were more revealing.     #P=Often, a point name will contain either a direct or veiled reference to the     point's function in the context of point associations.  These special groupings     are included where applicable.  ~GERB12 ~E Appendix B#r= contains further discussion of     special point groupings and the characters that are used to denote them.     #P=Explanations of point names constitute the major portion of the text. More     than one explanation for a point name is given where it adds to     the reader's understanding of function, location, or context.     #P=A work such as this is inevitably the work of many people. No list     could include all the individuals who have made this book possible. Special     thanks go to Bev Cubbage for her typing of the original draft, Huang Sheng-Jing     for her patient explanations of the difficult passages and her proficient typing     of Chinese characters, James Cleaver for his carefully considered comments on     parts of the manuscript, Fan Shi Lei for her willingness to be a walking Chinese     reference, and Hs~QO~RFu-Shu, Shi Neng-Yun, Chen     Jun-Chao, and Doctor James     Tin Yau So, the teachers who have nurtured my interest in Chinese medicine.     ~P0     ~SD0.5     ~SC48     ~L1     ~GERR12 ~E     ~Gx11,6.8,A     ~Gm0.2,0.2     ~Gx10.6,6.4,@     ~Gm1.2,1.2     ~L0     ~SD0.45     ~SL5.2     ~SR14.8     Two main styles of Chinese characters are used in this text.     ~GERJ12 ~E   Kai Shu, ~GERR12 ~E     a font that preserves the strokes used to form the characters     when hand written, is used for headings.  Students interested in writing Chinese may thus     see something of their construction.   The text characters     are ~GERJ12 ~E  Zhong Ming,~GERR12 ~E     a modern style designed     for readability when printed.There are stylistic differences.       #i=Sh~GEDI12 ~E ~Qz~R ~GERI12 ~E ~Gm-0.35,0 u#r=, for example,     when printed in #j=Zhong Ming#r= appears as:      «\. When printed in #j=Kai Shu#r= it is:     ~GCKV ~SC0 ~GO48 ~SD0.45      «\.  See ~GERB12 ~E Appendix A ~GERR12 ~E and ~GERB12 ~E     Appendix B ~GERR12 ~E for further discussion of #i=sh~GEDI12 ~E ~Qz~R ~GERI12 ~E ~Gm-0.35,0 u.#r=     ~F     #START=     ~Gm0,1     ~P0     #CHE= Table of Contents     ~L0     ~SC48     ~SD0.5     ~GERR12 ~E     ~SH14.7,0     ~Gm0,0.75     ~P0     #b=Part I: Characters#r=          Introduction~H1          Influences on the Development of Point Names~H1          Point Name Taxonomy~H3          A Brief Discussion of Chinese Characters~H9          Radicals~H10          Character Categories~H16          ~Gm0,0.75     #b=Part II: Point Names#r=          The Lung Channel~H23          The Large Intestine Channel~H36          The Stomach Channel~H56          The Spleen Channel~H100          The Heart Channel~H120          The Small Intestine Channel~H128          The Bladder Channel~H143          The Kidney Channel~H196          The Pericardium Channel~H223          The Triple Burner Channel~H231          The Gallbladder Channel~H252          The Liver Channel~H291          The Conception Vessel~H303          The Governing Vessel~H327          Appendix A: Glossary of Single Characters~H353          Appendix B: Special Point Groupings~H414          Index One: (English) Main Point Names~H419          Index Two: (Pinyin) Primary & Alternate Point Names~H429          Bibliography~H456          Alphanumeric Point Index~H461          ~F     ~GERR72 ~E     ~L1     ~SD4     ~Gm0,4     P~Gm-0.3,0 A ~Gm-1.1,0 R ~Gm-1.2,0 T I     Characters      _**`mac.1`_**               [set searchcase exact]     [c/a1/+1aI12/*][top]     [c/a2/~QD~R/*][top]     [c/a3/+3aI12/*][top]     [c/a4/~QH~R/*][top]     [c/a5/~QL~R/*][top]     [c/ai1/+1aI12i/*][top]     [c/ai2/~QD~Ri/*][top]     [c/ai3/+3aI12i/*][top]     [c/ai4/~QH~Ri/*][top]     [c/ai5/~QL~Ri/*][top]     [c/an1/+1aI12n/*][top]     [c/an2/~QD~Rn/*][top]     [c/an3/+3aI12n/*][top]     [c/an4/~QH~Rn/*][top]     [c/an5/~QL~Rn/*][top]     [c/ang1/+1aI12ng/*][top]     [c/ang2/~QD~Rng/*][top]     [c/ang3/+3aI12ng/*][top]     [c/ang4/~QH~Rng/*][top]     [c/ang5/~QL~Rng/*][top]     [c/ao1/+1aI12o/*][top]     [c/ao2/~QD~Ro/*][top]     [c/ao3/+3aI12o/*][top]     [c/ao4/~QH~Ro/*][top]     [c/ao5/~QL~Ro/*][top]     [c/e1/+1eI12/*][top]     [c/e2/~QE~R/*][top]     [c/e3/+3eI12/*][top]     [c/e4/~QI~R/*][top]     [c/e5/~QM~R/*][top]     [c/en1/+1eI12n/*][top]     [c/en2/~QE~Rn/*][top]     [c/en3/+3eI12n/*][top]     [c/en4/~QI~Rn/*][top]     [c/en5/~QM~Rn/*][top]     [c/eng1/+1eI12ng/*][top]     [c/eng2/~QE~Rng/*][top]     [c/eng3/+3eI12ng/*][top]     [c/eng4/~QI~Rng/*][top]     [c/eng5/~QM~Rng/*][top]     [c/er1/+1eI12r/*][top]     [c/er2/~QE~Rr/*][top]     [c/er3/+3eI12r/*][top]     [c/er4/~QI~Rr/*][top]     [c/er5/~QM~Rr/*][top]     [c/ei1/+1eI12i/*][top]     [c/ei2/~QE~Ri/*][top]     [c/ei3/+3eI12i/*][top]     [c/ei4/~QI~Ri/*][top]     [c/ei5/~QM~Ri/*][top]     [c/ji1/+1jiI12/*][top]     [c/i1/+1iI12/*][top]     [c/i2/~QU~R/*][top]     [c/i3/+3iI12/*][top]     [c/i4/~QY~R/*][top]     [c/i5/~Q]~R/*][top]     [c/in1/+1iI12n/*][top]     [c/in2/~QU~Rn/*][top]     [c/in3/+3iI12n/*][top]     [c/in4/~QY~Rn/*][top]     [c/in5/~Q]~Rn/*][top]     [c/ing1/+1iI12ng/*][top]     [c/ing2/~QU~Rng/*][top]     [c/ing3/+3iI12ng/*][top]     [c/ing4/~QY~Rng/*][top]     [c/ing5/~QY~Rng/*][top]     [c/o1/+1oI12/*][top]     [c/o2/~QF~R/*][top]     [c/o3/+3oI12/*][top]     [c/o4/~QJ~R/*][top]     [c/o5/~QN~R/*][top]     [c/ou1/+1oI12u/*][top]     [c/ou2/~QF~Ru/*][top]     [c/ou3/+3oI12u/*][top]     [c/ou4/~QJ~Ru/*][top]     [c/ou5/~QN~Ru/*][top]     [c/ong1/+1oI12ng/*][top]     [c/ong2/~QF~Rng/*][top]     [c/ong3/+3oI12ng/*][top]     [c/ong4/~QJ~Rng/*][top]     [c/ong5/~QN~Rng/*][top]     [c/u1"/+9uI12/*][top]     [c/u2"/+7uI12/*][top]     [c/u3"/+6uI12/*][top]     [c/u4"/+8uI12/*][top]     [c/u1/+1uI12/*][top]     [c/u2/~QG~R/*][top]     [c/u3/+3uI12/*][top]     [c/u4/~QK~R/*][top]     [c/u5/~QO~R/*][top]     [c/u6/+6uI12/*][top]     [c/u7/+7uI12/*][top]     [c/u8/+8uI12/*][top]     [c/un1/+1uI12n/*][top]     [c/un2/~QG~Rn/*][top]     [c/un3/+3uI12n/*][top]     [c/un4/~QK~Rn/*][top]     [c/un5/~QO~Rn/*][top]     [c/ui1/u+1iI12/*][top]     [c/ui2/u~QU~R/*][top]     [c/ui3/u+3iI12/*][top]     [c/ui4/u~QY~R/*][top]     [c/ui5/u~Q]~R/*][top]     [c/ue1"/+9eI12/*][top]     [c/ue2"/+8eI12/*][top]     [c/ue3"/+6eI12/*][top]     [c/ue4"/+7eI12/*][top]      _**`works.sty`_**               #START=     ~L0     ~SD0.5          #CHE=     ~GERB30 ~E     ~GJC          #CHP=     ~Gm0,1.5     ~GERJ24 ~E     ~GJC          #CHC=     ~Gm0,2     ~GCKV ~SC0 ~GO112     ~GJC          #HC=     ~Gm0,3     ~GCKV ~SC0 ~GO240     ~GJC          #SH=     ~Gm0,0.7     ~GCKV ~SC0 ~GO72     ~GERB14 ~E ~SD0.5          #HE=     ~Gm0,1.5     ~GERJ24 ~E     ~GJC          #RT=     ~SC48     ~SD0.5     ~P0     ~L1          #Aa=~GERB16 ~E          #Ab=~GERJ16 ~E          #Ac=~Gm0,0.3          #P=     ~L0     ~SC48     ~SD0.5     ~P0     ~GERR12 ~E          #G=     ~L0     ~SC48     ~SD0.5     ~Gm0,0.03     ~GERR12 ~E          #IP=     ~L0     ~SC48     ~SD0.5     ~GERI12 ~E          #O1=     ~L1     ~SC48     ~SD0.5     ~GERJ14 ~E     ~SH4.4,4.7,4.9,0          #O2=     ~L1     ~SC48     ~SD0.5     ~GERR12 ~E     ~SH4.4,4.7,4.9,0          #LOC=     ~L0     ~Gm0,0.3     ~GERB12 ~E     Classical Location:     ~SC48     ~SD0.5     ~GERR12 ~E          #ASS=     ~L0     ~P0     ~SD0.5     ~GERB12 ~E     Point Associations:     ~GERR12 ~E          #EX=     ~SD0.5     ~L0     ~Gm0,0.5     ~GERB14 ~E     Explanation of Point Name     ~P0     ~Gm0,0.2     ~GERR12 ~E          #ALT=     ~L1     ~SD0.5     ~Gm0,0.2     ~GERB12 ~E Alternate Names     ~GERR12 ~E     ~SH4.7,9.4,11.2,0          #ALT1=     ~L1     ~SD0.5     ~Gm0,0.2     ~GERB12 ~E Alternate Name     ~GERR12 ~E     ~SH4.7,9.4,11.2,0          #PN1=     ~L1     ~SD0.5     ~GERR12 ~E     ~SH4.7,6.3,9.2,13.5,0     ~Gm0,-0.3          #PN=     ~L1     ~SD0.5     ~GERR12 ~E     ~SH4.7,6.3,9.2,13.5,0     ~Gm0,-0.3          #PH=     ~L0          #b=~GERB14 ~E          #i=~GERI12 ~E          #r=~GERR12 ~E          #j=~GERJ12 ~E          #u=~GEUI10 ~E      _**`PE.PRO`_**               s blankcompress off     s searchcase exact     set margins 1 250 1     d up=[up]     d down=[down]     d left=[left]     d right=[right]     d pgup=[pu]     d pgdn=[pd]     d home=[bl]     d end=[el]     d ins=[it]     d del=[dc]     d enter=[il]     d backspace=[ro]     d esc=[cg]     d tab=[tw]     d f1=[e]     d f2=[save]     d f3=[m text.mac]     d f4=[quit]     d f5=[cc][bl][ee]'print'     d f6=[ps][mc][tw][left][mc][bm][dm][po]     d f7=[left][eb][bl]     d f8=[ee]     d f9=[bl][ee]     d f10=[dl]     d c-left=scrollleft 70     d c-right=scrollright 70     d c-pgup=[ps][ml][bo][bm][up 2][down 2][po]     d c-pgdn=[ps][ml][to][bm][down 2][up 2][po]     d c-home=     d c-end=     d c-enter=[ex]     d c-backspace=     d c-a='????'     d c-b=[down 55][il][bl]''     d c-c=[ps][ml][ci][um][po]     d c-d=[cc][bl][ee][ca]     d c-e=''     d c-f=[to][/**/]     d c-g=[pd][te]     d c-h=[cl]     d c-i=     d c-j=[jo]     d c-k=[edit .keydefs]     d c-l=[ps][ml][cm][po]     d c-m=[cc][bl][ee]'? margins'[ex][right 12]     d c-n=     d c-o=     d c-p=[ps][ml][fb][up][ml][rf][em][down 2][po]     d c-q=     d c-r=[rd]     d c-s=[sp]     d c-t=[cc][? tabs][right 11]     d c-u=[edit .unnamed]     d c-v=[ps][mc][l/.  /][mc][bm][dm][po]     d c-w=[ct]     d c-x=[es]     d c-y=[co]     d c-z='.\" '     d c-f1=[cc][bl][ee]'s margins 1 80 1'[bl][right 10]     d c-f2=[cc][bl][ee]'s margins 1 80 6'[bl][right 10]     d c-f3=[cc][bl][ee]'s margins 1 80 5'[bl][right 10]     d c-f4=[cc][bl][ee]'s margins 1 254 1'[bl][right 10]     d c-f5=     d c-f6=[ud]     d c-f7=     d c-f8=[e .unnamed][bo][up 1][ml][e][up 1][cm][um]     d c-f9=     d c-f10=     d c-minus='                    * * * * * * * * * * * * * * * * * * * *'     d c-backslash='* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *'     d s-up=[up 5]     d s-down=[down 5]     d s-left =[left 20]     d s-right =[right 20]     d s-pgup =[te]     d s-pgdn =[be]     d s-home =[to][bl]     d s-end =[bo][bl]     d s-pad5=     d s-ins=     d s-del=     d s-tab=[bw]     d s-f1=[dir a:][cd a:]     d s-f2=[dir b:][cd b:]     d s-f3=[ps][cd][ml][cm][column 9]'.'[column 14][ee][c/ //-*m][bl][sr][sr]'e'[ct][down][dm][ex][po]     d s-f4=[dos]     d s-f5=[dir]     d s-f6=     d s-f7=[ss]     d s-f8=[nv]     d s-f9=[nw]     d s-f10=[zw]     d s-0=')'     d s-1='!'     d s-2='@'     d s-3='#'     d s-4='$'     d s-5='%'     d s-6='^'     d s-7='&'     d s-8='*'     d s-9='('     d s-minus='_'     d s-equals='+'     d s-lbracket='{'     d s-rbracket='}'     d s-semi=':'     d s-quote='"'     d s-backquote='~'     d s-comma='<'     d s-period='>'     d s-slash='?'     d s-backslash='|'     d a-a=[bm]     d a-b=[mb]     d a-c=[mc]     d a-d=[dm]     d a-e=[em]     d a-f=[fm]     d a-g=[uc]     d a-h=[lc]     d a-i=     d a-j=     d a-k=     d a-l=[ml]     d a-m=[mm]     d a-n=     d a-o=[ob]     d a-p=[pm]     d a-q=     d a-r=[rf]     d a-s=[ps][ml]     d a-t=[ct]     d a-u=[um][po]     d a-v=[ci]     d a-w=     d a-x=[sr]     d a-y=[cm]     d a-z=[sl]     d a-f1='P'     d a-f2='M'     d a-f3='g'     d a-f4='p1'     d a-f5='p0'     d a-f6='-'     d a-f7='-0'     d a-f8='8'     d a-f9=[ps][mc][down 57][el][mc][pm][po][down][bl]     d a-f10='9'     d a-0='HT'     d a-1='a2'     d a-2=''     d a-3=''     d a-4='4'     d a-5='5'     d a-6='E'     d a-7='F'     d a-8='S '     d a-9='S'     d a-minus=''     d a-equals=''     d u-up=     d u-down=     d u-left=     d u-right=     d u-pgup=     d u-pgdn=     d u-home=     d u-end=     d u-ins=     d u-del=     d u-enter=     d u-backspace=     d u-esc=     d u-tab=     d u-a=     d u-b=     d u-c=     d u-d=     d u-e=     d u-f=     d u-g=     d u-h=     d u-i=     d u-j=     d u-k=     d u-l=     d u-m=     d u-n=     d u-o=     d u-p=     d u-q=     d u-r=     d u-s=     d u-t=     d u-u=     d u-v=     d u-w=     d u-x=     d u-y=     d u-z=     d u-f1=     d u-f2=     d u-f3=     d u-f4=     d u-f5=     d u-f6=     d u-f7=     d u-f8=     d u-f9=     d u-f10=     d u-0=     d u-1=     d u-2=     d u-3=     d u-4=     d u-5=     d u-6=     d u-7=     d u-8=     d u-9=     d u-minus=     d u-equals=     d u-lbracket=     d u-rbracket=     d u-semi=     d u-quote=     d u-backquote=     d u-comma=     d u-period=     d u-slash=     d u-backslash=     d u-prtsc=     d u-padplus=     d u-padminus=     d u-pad5=     d u-space=     set tabs 10 20 30 40 50 60 70 80      What I tried includes some reading **_`troff`_** website, using grog( ** _`crosspost`_**), but being very less known about this, it would be great if someone help me to compile those files to produce PS/PDF. Reference to specific resources would be appreciated. I am using **_`cygwin`_** on **_`Windows SP3`_**.


title: Mounting ufs partition with read/write permissions on ubuntu 10.04

text: According to this writeup ufs kernel module is compiled with only read permissions. I could mount a ufs partition with this command:               sudo mount -t ufs -r -o ufstype=ufs2 /dev/mapper/loop0p1 /mnt/freebsd/      And it mounts the filesystem without write permissions. There is a ufs-utils package for Debian/Ubuntu but I could not figure out how to use it. So there any way to get read/write permissions work for ufs on Ubuntu/Linux.


title: $PATH environment variable does not seem to be recognized

text: I've made a fresh install of Debian Wheezy, and installed zsh to it. Few days after, I've done a vanilla installation of TeX Live 2014, so I added the necessary binary paths to my $PATH. Now I started writing little scripts so I would like to put them somewhere easily accessible, that is `~/bin`. My path looks like this:               ~/bin:/opt/texbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games      Now, if I wanted to run something from TeX Live, it's easy:               % which pdflatex     /opt/texbin/pdflatex      No problem. But when I try running something from `~/bin`, ...               % which hello_world     hello_world not found      So I double-checked:               % ls -l ~/bin     total 18     -rwxr-xr-x 1 bozbalci bozbalci 5382 Sep  8 00:28 hello_world      And it shows that hello_world is doing fine in `~/bin` with its execution permissions set. I've tried `rehash`, but it didn't work. Help?


title: Can I set how long ssh-agent keeps keys in memory?

text: I'd like to have my keyfiles leave memory after a certain amount of disuse. Is there a way to make `ssh-agent` expire keys faster? It feels like it keeps them in memory and not needing a passphrase for really long periods of time.


title: How can I see output from a command progressively?

text: I have fired an `ls -1` command that runs and displays a long list of values. When the command ends I can not see the output which is outside the screen vertical length. How can I see those previous entries ? Is there a way to see the output progressively like :   1. Display first 15 rows    2. User hits a keystroke.   3. Then display the next 15 records


title: Desktop settings no longer being applied

text: So my Mint setup (Mint 17 on a Lenovo Yoga 13) was working perfectly fine earlier this morning. However, I pressed Ctrl+Alt+PgDn while trying to change between workspaces and it turned the entire screen into a terminal window (similar to the one seen when hitting Alt+F2 at the login screen). I logged in using my information, realized I just needed to reboot, and then did so. However, when I logged back in, my entire desktop was reset to default settings and I couldn't change any of my desktop settings at all. It turns out my home folder's permissions had been changed from my account to root, so I changed them back to how they originally were and rebooted. The issue still persisted however, so I honestly have no idea what to do at this point. Now every time I log in my desktop resets itself as if Mint was just installed. My applications work fine however. I may be missing something really obvious so if anyone has any thoughts it'd be much appreciated.


title: Bash autocomplete: first list files then cycle through them

text: Is it possible to configure bash in such a way that on the first tab autocomplete it lists all possible files and on subsequent ones cycles through the choices? Both options are easy to do separately and I could bind them to different keys, but the above would be perfect, but I can't find anything about it on the net.


title: Is there a way to remap the AltGr key to Ctrl with setxkbmap?

text: I've already checked the option section in `/usr/share/X11/xkb/rules/base.lst` but I didn't find an entry for `AltGr`...


title: Intel Corporation 82852/855GM Integrated Graphics Device on Fedora 18: No drivers?

text: I've just installed Fedora 18 on an old laptop, and it seems I can't get drivers for the graphics card. "Intel Corporation 82852/855GM Integrated Graphics Device" is what `lspci` is reporting, but I'm struggling to find proprietary drivers, or a package for it. I've added RPM Fusion packages, but still, no drivers. Where (if there are any at all) do I get them?


title: Testing ext3 filesystem on embedded device

text: My set up: An embedded device with flash memory on it. Flash is partitioned into ext3 filesystem partitions. Have busybox on it. My Goal: To uncover errors /bugs/ problems on ext3 filesystems. Linux version: Not the latest and greatest: linux-2.6.31 What tests should I run to uncover potential problems in the ext3 filesystem?


title: Formatting secondary hard drive that has windows on it

text: I recently installed an setup an Ubuntu Server machine. It has two drives in it and the other drive has windows installed on it. (I didn't want to overwrite the windows installation until I had my server setup and working). Now I would like to format that hard drive so that I can use it as a remote time machine backup for my mac. So my question is, how can I format that drive to be available from the server and also have grub forget about the windows installation? (all without affecting the existing ubuntu installation). Also keep in mind, I need this to either be a command line solution or something I can run from a usb drive. Thanks!


title: Git hangs indefinitely when trying to push --all to GitHub

text: When I try and push `\--all` to GitHub, the Git transfer starts out fast, slows down, and eventually stops. It doesn't fail, it just slows to a halt. What's going on? This is really frustrating, I'd like to get my code pushed, but every time I try this, it slows to a stop. I've tried on multiple networks, so I don't think it's my network connection.


title: how to have find on a directory with a changing pattern?

text: I have a folder structure like this:               /domains/some-domain-1/applications/j2ee-apps     /domains/some-domain-2/applications/j2ee-apps     /domains/some-domain-3/applications/j2ee-apps      What is the best way to handle folders like this where the parent and child folders are the same? For example, if I wanted to `cd` to a cousin dir `j2ee- apps` of another domain folder from is there an easy way? What if I wanted to run a `ls` from the top level and get everything in the bottom folders (eg: `j2ee-apps`)? Does anyone have any clever advice on how best to work with this?


title: touch all folders in a directory

text: I am trying to update the timestamps of all folders in the cwd using this:               for file in `ls`; do touch $file; done      But it doesn't seem to work. Any ideas why?


title: Compare the contents of dynamically generated archives

text: Short question: I have two dynamically generated tar archives (so they have different timestamps), how can I compare them, ignoring any different in time? Backgrounds... I am doing some backup, in which I use a script to generate things that needs to be backed up, put them in to a directory, then tar the directory and keep several old versions. The backup script needs to run every 30 minutes to make sure we don't lose hours of work. Now I realize that there are periods of time that the data doesn't change, so it doesn't make sense to store duplicates of the same thing over and over again. I would like to compare the archives before saving. My attempt was to run `cmp newdata.tar.gz olddata.tar.gz` and only store `newdata.tar.gz` if it contains new data. Apparently that didn't work, because there are different timestamps.


title: How to setup ssh over USB on an embedded linux device?

text: I have an embedded linux device with an ARM processor. I am connecting to it over a USB port using minicom. What should I do to "ssh" into the device through the USB connection? I want to setup something like the following setup for beagle bone: https://learn.adafruit.com/ssh-to-beaglebone-black-over-usb/overview **Edit:** My device is _not_ a beagle bone. The above link is provided as an example of what I am trying to achieve.


title: change the extension of all files based on user input

text: I was taking an online assessment and I got the below question.   * Create a script located at `/usr/local/bin/set-file-extensions` that will change the extension of all files in the directory `/var/dump/files` based on user input.   * The script should support the option flag `-E` that will allow a user to pass a three character extension(.i.e `log`).   * If a non three character extension is passed by the user, display the error " **Invalid input. A three character extension is required.** " and exit with a status code of 19.   * Once that file extension is received, the script should rename all files under the directory `/var/dump/files` with the given extension. I.e. A file named `myfile` should be renamed as `myfile.log`.


title: Unexpected condition outcome in a ksh script

text: I'm new to shell scripting. The below code is not working. Can anyone help me on this? I've given explanation for all the lines:               #!/bin/ksh     cat example.txt | while read LINE                 # reading line from file     do         var=$LINE                                     # assigning line to variable         echo $var                                     # printing the line         H_OR_T="${var:0:6}"                           # taking substring from the line          echo $H_OR_T                                  # printing the substring      up to here the code is working fine. If H_OR_T variable holds the hardcoded value (i.e., M$9001 kindly take a look on if condition below) I should enter the loop. But here I'm getting arithmetical errors. I've tried all the possible ways still, and I'm facing the same issue.                   if [[ $H_OR_T = "M$9001" ] || [ $H_OR_T = "M$9002" ]];             then            echo "************** MOVING HEADER OR TRAILER RECORD TO DOMESTIC FILE ************"            awk '{print $0}' example.txt > domestic.txt         else            echo "**************** MOVING RECORD TO LOGGER FILE **********************"            awk '{print $0}' example.txt > logger.txt         fi     done


title: How do I get an HP Deskjet F4210 to work?

text: I brought to home my friend's printer (HP Deskjet F4210). I'm using Xubuntu 10.04.   When I use the command                 lpr scanned.pdf      the printer does nothing. `lpq` writes               Deskjet-F300-series is not ready     Rank    Owner   Job     File(s)                         Total Size     1st     xralf 61      scanned.pdf                     1690624 bytes     2nd     xralf 62      (stdin)                         0 bytes     3rd     xralf 63      scanned.pdf                     1690624 bytes      I installed the driver according to this manual It was possible to print a test page after installation. Could you help me to figure out what is wrong?


title: dnsmasq no address available?

text: I am getting this error in my `/var/log/messages` file.               dnsmasq-dhcp[xxxx] DHCPDISCOVER(xxxxxx) xx:xx:xx:xx no address available      How can I tell what leases dnsmasq has leased out? And how can I free them up? I'm running RedHat Enterprise Linux 6.5


title: Suppress warning from ps -aux on Linux

text: When I run the `ps` command i get a warning saying `Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ`. How do i suppress this warning? Is there some system setting that i must do for this. The command that I fire is:               [root@localhost home]# ps -aux | grep "curl -s -o Test"      Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ     root      4856  0.0  0.0   4044   672 pts/0    S+   07:20   0:00 grep curl -s -o Test     [root@localhost home]#       Note that I have to fire the exact same command as above(I cannot change the `-aux` to `aux`, I cannot redirect `STDERR` output). That is why i am looking for some system setting that will suppress the warning.


title: Looking for an efficient way to display PDFs

text: I've used several unix tools to display PDFs, like `xpdf`, `evince`, `epdfview`… What I'm looking for is not very complicated. I'd like to display a full page inside the application window with **reduced margins** (no margins or very small margins) and be able to go to the **next/previous page** by simply pressing one button. I don't know any PDF viewer which can be configured to do that. Does anyone know how it could be done?


title: What's the best way to join files again after splitting them?

text: If I have a large file and need to split it into 100 megabyte chunks I will do               split -b 100m myImage.iso      That usually give me something like               xaa     xab     xac     xad      And to get them back together I have been using               cat x* > myImage.iso      Seems like there should be a more efficient way than reading through each line of code in a group of files with `cat` and redirecting the output to a new file. Like a way of just opening two files, removing the `EOF` marker from the first one, and connecting them - without having to go through all the contents. Windows/DOS has a copy command for binary files. The help mentions that this command was designed to able able to combine multiple files. It works with this syntax: (`/b` is for binary mode)               copy /b file1 + file2 + file3 outputfile      Is there something similar or a better way to join large files on Linux than cat? **Update** It seems that `cat` is in fact the right way and best way to join files. Glad to know i was using the right command all along :) Thanks everyone for your feedback.


title: A simpler way of comparing md5 checksum?

text: After downloading a file that has a md5 checksum available I currently check it with               md5 *file* | grep *given_checksum*      e.g.               md5 file.zip | grep -i B4460802B5853B7BB257FBF071EE4AE2      but it seemed funny to me to require grep and the pipe for what is surely a very common task. A stickler for doing things efficiently, I wondered there is a better way of doing this?


title: make reposync ignore /etc/yum.conf?

text: Is there a way to make reposync ignore /etc/yum.conf ? When i use `reposync --config=/my/path/to/alternative/inputrepo.conf` it's still picking up repositories for consideration inside `/etc/yum.repos.d` My alternative/inputrepo.conf just looks like:               [varnish]     name=varnish     baseurl=http://repo.varnish-cache.org/redhat/varnish-3.0/el6/x86_64/      ...but reposync still picks up the google-chome repo, which is only in /etc/yum.repos.d/ and complains about varnish being defined twice. This is a problem for me because some of the mirrors i want to sync are also present on the system in /etc/yum.repos.d/, but with different baseurls.


title: How do I change the color of the pane dividing lines in tmux?

text: I've used the following command to change the color of the status bar at the bottom of the screen: > set -g status-bg colour244 But I don't know how to change the color of the lines that divide the panes, currently they're a mix of the original green and gray (color244). `man tmux` gives me alot of info about the _status line_ but this seems to refer to the status bar itself, not the dividing lines. I suspect I'm just missing some terminology here...


title: Where are Apache file access logs stored?

text: Does anyone know where file access logs are stored, so I can run a `tail -f` command in order to see who is accessing a particular file. I have XAMPP, which is an Apache server installed on my machine, which automatically logs the accesses. It is stored in my installation folder.


title: How can I extract a specific string from a file?

text: I am having difficulties parsing my data. In the file shown below, I want to get the characters after `BIG**20021208*00001**`. I tried `sed '/BIG.20021208.00001\\**/!d;s///;s/\\*.*//'` but it doesn't work. I think the problem has to do with the line separator (`…`).               BIG*20021208*00001**A1001…      TO*7284*0001…BIG*20021208*00001**A999…      NN*ST*XYZ Test Corporation*9*122334455…      NU*987 ELS.…      N4**NY*98765…      ITD*01*3*2**30**45*****60…      N3*123 Highway Street…      N4**12345…      ITD*001*3*2**30**30*****60…      BIG*20021208*00001**8263-83313…      ITD*001*3*2**30**30*****60…      BIG*20021208*00001**8263-83313…       My expected output is:               A1001     8263-83313     8263-83313


title: How can I turn ugly output into pretty, useful information?

text: How can I turn this ugly output into pretty, useful data? **The output:**               /* ---------- TA#box#AbC_p ---------- */          insert_job: TA#box#AbC_p    job_type: a     #owner: bob     permission: gx     date_conditions: 1     days_of_week: su     start_times: "16:15"     run_window: "16:15-17:30"     description: "Job AbC that runs at 4:15PM on Sundays, and should end before 5:30PM"              /* ---------- TA#cmd#EfGJob_p ---------- */              insert_job: TA#cmd#EfGJob_p    job_type: b         box_name: TA#box#AbC_p         command: /path/to/shell/script.sh         machine: vm_machine1         #owner: alex         permission: gx         date_conditions: 2         run_window: "16:20-16:30"         description: "job EfG that runs within box AbC"         term_run_time: 60         std_out: /path/to/log.log         std_err: /path/to/err.log         alarm_if_fail: 1         profile: /path/to/profile      and so on, for a long time. #cmd# jobs are sometimes under a #box#. If they are under a #box#, the #cmd# section is indented. My ideal output would be something like:               "Job Name", "Time", "Schedule", "Machine", "Description", "Command"     "TA#box#AbC_p", "16:15", "su", "", "Job AbC that runs at 4:15PM on Sundays, and should end before 5:30PM", ""     "TA#cmd#EfGJob_p", "16:15", "su", "vm_machine1", "job EfG that runs within box AbC", "/path/to/shell/script.sh"      I'm trying awk, perl and grep, but I'm having trouble keeping all the info for one "section" together before I print the CSV line.


title: Vi mode in other console programs

text: I quite like the Vi mode of bash. Is there any way to make it work in other programs (gnuplot for instance)? **EDIT:** As Shawn suggested below, configuring `.inputrc` and using `rlwrap -a -c gnuplot` gives Vi mode for gnuplot.


title: What Is The Difference Between A Recursive Dependency Check And A Reverse Dependency Check?

text: My understanding of software dependencies is that a program package may require other packages to be installed, termed dependencies. A tree-like result ensues. Sometimes packages share common dependencies, but the package only needs to be installed once.                                                       |Package D                       | Package B --------->|                       |                     |Package E     Package A ------->|                       |                     |Package F                       | Package C --------->|                                             |Package B      I recently posted a question on AskUbuntu.com about finding the dependencies of a package, and all the ways of doing this gave me different results. The reason for this was that some of the methods were apparently listing more than just dependencies, some were performing recursive checks, and some were performing reverse checks. **What is the difference between a reverse dependency check, and a recursive dependency check?** **EDIT:** Citations for terms. I first heard them in the comments of a thread I posted about APT, but they are used in several programs that can be used to do dependency checks as well as on their manpages. > apt-cache rdepends is looking for Reverse dependencies, my script and apt- > rdepends are recursively looking for dependencies.   * Source: http://askubuntu.com/questions/492435/how-to-download-apt-and-all-its-dependencies               rdepends pkg(s)                rdepends shows a listing of each reverse dependency a package has.        * Source: http://manpages.ubuntu.com/manpages/natty/man8/apt-cache.8.html               apt-rdepends - performs recursive dependency listings similar to            apt-cache        * Source: http://manpages.ubuntu.com/manpages/natty/en/man8/apt-rdepends.8.html


title: Debian: Must pkill -9 twm and then login with twm

text: I was experimenting with my Debian system (it says wheezy/sid when I log in with tty), and broke it somehow. When I start, there is a black screen with a watch cursor. It stays like that, but if I hit the usual, say, Ctrl-Alt-F6, I get tty. Here, among the processes listed below, I found that pkill -9 twm will immediately bring me away from tty to the GUI view (formerly the black screen), where there is the familiar login screen. It is not possible to do a normal login, but using twm works. (Probably I messed up Gnome. aptitude says cannot do anything: abort because too many errors.) As for me, twm is not at all unpleasant, so my question is, do you have any idea how to get away with that initial pkill?               UID        PID  PPID  C STIME TTY          TIME CMD     root         1     0  0 18:16 ?        00:00:01 init [2]              root         2     0  0 18:16 ?        00:00:00 [kthreadd]     root         3     2  0 18:16 ?        00:00:00 [ksoftirqd/0]     root         4     2  0 18:16 ?        00:00:00 [kworker/0:0]     root         5     2  0 18:16 ?        00:00:00 [kworker/u:0]     root         6     2  0 18:16 ?        00:00:00 [migration/0]     root         7     2  0 18:16 ?        00:00:00 [watchdog/0]     root         8     2  0 18:16 ?        00:00:00 [cpuset]     root         9     2  0 18:16 ?        00:00:00 [khelper]     root        10     2  0 18:16 ?        00:00:00 [kdevtmpfs]     root        11     2  0 18:16 ?        00:00:00 [netns]     root        12     2  0 18:16 ?        00:00:00 [sync_supers]     root        13     2  0 18:16 ?        00:00:00 [bdi-default]     root        14     2  0 18:16 ?        00:00:00 [kintegrityd]     root        15     2  0 18:16 ?        00:00:00 [kblockd]     root        16     2  0 18:16 ?        00:00:00 [kworker/0:1]     root        17     2  0 18:16 ?        00:00:00 [khungtaskd]     root        18     2  0 18:16 ?        00:00:00 [kswapd0]     root        19     2  0 18:16 ?        00:00:00 [ksmd]     root        20     2  0 18:16 ?        00:00:00 [khugepaged]     root        21     2  0 18:16 ?        00:00:00 [fsnotify_mark]     root        22     2  0 18:16 ?        00:00:00 [crypto]     root       114     2  0 18:16 ?        00:00:00 [khubd]     root       129     2  0 18:16 ?        00:00:00 [ata_sff]     root       131     2  0 18:16 ?        00:00:00 [scsi_eh_0]     root       132     2  0 18:16 ?        00:00:00 [scsi_eh_1]     root       133     2  1 18:16 ?        00:00:04 [kworker/u:1]     root       134     2  0 18:16 ?        00:00:00 [kworker/u:2]     root       144     2  0 18:16 ?        00:00:00 [kworker/0:2]     root       147     2  0 18:16 ?        00:00:00 [kworker/0:3]     root       174     2  0 18:16 ?        00:00:00 [kjournald]     root       259     1  0 18:16 ?        00:00:00 udevd --daemon     root       409     2  0 18:16 ?        00:00:00 [kpsmoused]     root       442     2  0 18:16 ?        00:00:00 [hd-audio0]     root      1106     2  0 18:16 ?        00:00:00 [flush-8:0]     root      1118     1  0 18:16 ?        00:00:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0     daemon    1342     1  0 18:16 ?        00:00:00 /sbin/portmap     root      1421     1  0 18:17 ?        00:00:00 /usr/sbin/rsyslogd -c5     101       1455     1  0 18:17 ?        00:00:00 /usr/bin/dbus-daemon --system     root      1479     1  0 18:17 ?        00:00:00 /usr/sbin/acpid     root      1512     1  0 18:17 ?        00:00:00 /usr/sbin/gdm3     root      1535  1512  0 18:17 ?        00:00:00 /usr/lib/gdm3/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1     root      1537  1535  0 18:17 tty7     00:00:00 /usr/bin/Xorg :0 -br -verbose -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-TSeI8C/database -nolisten tcp vt7     root      1541     1  0 18:17 ?        00:00:00 /usr/sbin/acpi_fakekeyd     root      1614     1  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     daemon    1642     1  0 18:17 ?        00:00:00 /usr/sbin/atd     avahi     1670     1  0 18:17 ?        00:00:00 avahi-daemon: running [VLAN-3434.local]     avahi     1671  1670  0 18:17 ?        00:00:00 avahi-daemon: chroot helper     www-data  1691  1614  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     www-data  1692  1614  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     www-data  1693  1614  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     www-data  1694  1614  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     www-data  1695  1614  0 18:17 ?        00:00:00 /usr/sbin/apache2 -k start     root      1728     1  0 18:17 ?        00:00:00 /usr/sbin/bluetoothd     root      1778  1535  0 18:17 ?        00:00:00 /usr/lib/gdm3/gdm-session-worker     root      1788     1  0 18:17 ?        00:00:00 /usr/lib/accountsservice/accounts-daemon     root      1789     1  0 18:17 ?        00:00:00 /usr/sbin/console-kit-daemon --no-daemon     root      1877     1  0 18:17 ?        00:00:00 /usr/sbin/cron     root      1911     1  0 18:17 ?        00:00:00 /usr/lib/policykit-1/polkitd --no-debug     root      1922   259  0 18:17 ?        00:00:00 udevd --daemon     root      1923   259  0 18:17 ?        00:00:00 udevd --daemon     root      1927     2  0 18:17 ?        00:00:00 [kauditd]     root      1934     1  0 18:17 ?        00:00:00 /usr/sbin/cupsd -C /etc/cups/cupsd.conf     incal     1937  1778  0 18:17 ?        00:00:00 twm     colord    1942     1  0 18:17 ?        00:00:00 /usr/lib/i386-linux-gnu/colord/colord     colord    1970     1  0 18:17 ?        00:00:00 /usr/lib/i386-linux-gnu/colord/colord-sane     root      2002     1  0 18:17 ?        00:00:00 /usr/sbin/kerneloops     incal     2045  1937  0 18:17 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session twm     incal     2048     1  0 18:17 ?        00:00:00 /usr/bin/dbus-launch --exit-with-session twm     incal     2109     1  0 18:17 ?        00:00:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session     root      2129     1  0 18:17 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe     mysql     2443  2129  0 18:17 ?        00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/run/mysqld/mysqld.pid --socket=/run/mysqld/mysqld.sock --port=3306     root      2444  2129  0 18:17 ?        00:00:00 logger -t mysqld -p daemon.error     102       2812     1  0 18:17 ?        00:00:00 /usr/sbin/exim4 -bd -q30m     root      2938     1  0 18:17 ?        00:00:00 /usr/sbin/sshd     root      3016     1  0 18:17 ?        00:00:00 /usr/sbin/minissdpd -i 0.0.0.0     root      3032     1  0 18:17 tty1     00:00:00 /sbin/getty 38400 tty1     root      3033     1  0 18:17 tty2     00:00:00 /sbin/getty 38400 tty2     root      3034     1  0 18:17 tty3     00:00:00 /sbin/getty 38400 tty3     root      3035     1  0 18:17 tty4     00:00:00 /sbin/getty 38400 tty4     root      3036     1  0 18:17 tty5     00:00:00 /bin/login --           root      3037     1  0 18:17 tty6     00:00:00 /sbin/getty 38400 tty6     incal     3066  3036  0 18:19 tty5     00:00:00 -bash     incal     3133  3066  0 18:20 tty5     00:00:00 ps -Af


title: Finding files by their owner and file permissions

text: I'm trying to `find` files which are owned and have the primary group of `root`. Is there a parameter available to search for files like this? It's critical that all files in a certain directory _not_ be owned by `root`, so I'd like to check periodically to make sure that someone on the server isn't accidentally creating files owned by `root` (namely me). Sure, `chown -R user:user /path` works, but I'd like to be able to check.


title: What does ^> mean in a grep pattern?

text: What does this command do?               grep "<[^>]*>" inuux.xml      What is searching for?


title: National characters in manpages

text: I am trying to get a proper display of national characters with FreeBSD **man**. I have tried running the following on 8.1 and 9.0:               # PAGER=less LANG="pl_PL.UTF-8" man -d -M. ./man.1     -- Using architecture: i386:i386     -- Using pager: less     -- Using manual sections: 1:1aout:8:2:3:n:4:5:6:7:9:l     -- Using locale paths: pl_PL.UTF-8:pl.UTF-8:en.UTF-8:.     -- Using standard page width     -- Searching for ./man.1     -- Found a usable page, displaying that     -- Command: /usr/bin/zcat -f ./man.1 | tbl | groff -S -P-h -Wall -mtty-char -man -Tascii -P-c | less      But it prints: > Program man jest systemowA przeglAdarkA stron podrAcznika > ekranowego.KaA1/4dy argument... The same manpage displays properly on a Linux host: > Program man jest systemową przeglądarką stron podręcznika ekranowego. Każdy > argument... I have been told by a knowledgeable person that manpages on 9.0 _are supposed_ to display properly. What am I missing?


title: Where does Firefox 10 look for plugins?

text: I installed Firefox 10 into `~/firefox`. I've downloaded Adobe Flash Player into `~/flashplayer`. In the past, I could symlink `libflashplayer.so` into `~/firefox/plugins`. But now, when I look, there is no `plugins` directory inside `firefox`. So where does Firefox look for its plugins?


title: Prioritise X applications with focus

text: Is there a way to prioritise X applications with focus, preferably both in terms of CPU and I/O? Something like all X applications are niced and ioniced down in priority, but when they gain focus they get niced and ioniced back up to normal levels. I don't want to reinvent the wheel, so I was hoping someone had already developed an application that does this.


title: How to fix mistake in grub.cfg from LiveCD?

text: Playing around with the GRUB2 configuration, I did something wrong, which caused the system to fail booting. I would like to fix the issue by re-editing the GRUB configuration file using Fedora 16 LiveCD. I proceeded as follow:   * mount my system partition [OK]   * become super user [OK]   * sudo gedit the /etc/default/grub to restore it as it was prior [OK]   (Somehow I had to "sudo" although I already was super-user, that's confusing).   * sudo grub2-mkconfig -o /media/MYPARTITION/boot/grub2/grub.cfg The last step however returned the file system is read only. So I failed to restore the configuration of GRUB2 :( How should I proceed?


title: Signing GRUB bootloader

text: The laptop I recently bought uses UEFI. As an experiment, I think it would be really cool to generate my own keys and use them to sign my bootloader, and also to password protect the bootloader. How would I go about this?


title: Why does backslash get converted to space in echo statement if IFS='\'?

text: Why is `\` is converted to space on setting `IFS='\'`               var="'(]\\{}\$\""     IFS='\'     echo $var # '(] {}$"


title: iptables redirect FORWARD http traffic to privorxy port

text: Ideally i m trying to use my laptop and a 3Gphone as a WiFi router to redirect FORWARD HTTP but not HTTPS Traffic to privoxy which then forwards the traffic via a SSH tunnel to a ziproxy VPS. for the sake of simplicity privoxy is currently set to defaults ie is not forwarding to another proxy. with exception to accept intersepts 1 also sysctl net.ipv4.ip_forward=1 the following iptable commands work locally but is ignored by FORWARD traffic ie users connected by wifi are not filtered by privoxy but the local user is, i want the opposite behaviour               iptables -t nat -A POSTROUTING -o ${INTERNET_IFACE} -j MASQUERADE     iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner privoxy -j ACCEPT     iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8118     iptables -A FORWARD -i ${WIFI_IFACE} -j ACCEPT      How do I force FORWARD HTTP traffic to go through privoxy ?


title: How to use screen rotation in Awesome WM configuration?

text: I'm using an `xrandr` script to set screen size and rotation. In this case one screen is in landscape mode and the other is rotated. How can I detect this rotation in the Awesome WM configuration? The goal is to set the tag layout so that the windows are divided along the short axis of the screen. That is, a tag which uses `awful.layout.suit.tile` in landscape mode would use `awful.layout.suit.tile.bottom` in portrait mode.


title: How to browse file from sudoer account from guest account?

text: As I've mentioned earlier, I have been facing problem regarding isues with loging in with my primary account. I want to browse my files from that primary account using guest account. Is there any way to do that without logging in into primary account? If yes, what are they?


title: Printing match groups with grep

text: I have the following grep:               grep -Po 'href="(http://.*)">Transcript.* - ([0-9]*)\. (.*)</a>'      I would like to print out the match groups. Is there a way to do this without Perl/Python? I tried using `sed`, but I couldn't manage to make it work -- probably due to syntax issues, I'm not really sure what needs to be escaped and what not.


title: what are the different ways to set file permissions etc on gnu/linux

text: On Unix a long time back I learned about `chmod` to set permissions and to allow programs to gain privileges. I have recently discovered extra commands on GNU/Linux: `chattr`, `setfacl`, `setcap`. Are there any others?


title: How to solve problem related to black screen with cursor only after loging in?

text: Suddenly, I got crash report after logging in to my primary account. It says "cannot open display". But, everything work just fine while loging in with "Guest" account. I tried using these methods which didn't work for me: METHOD 1: After getting that black screen I pressed ctrl + alt + f1 key, then after loging in with primary username. I started typing these command:               sudo apt-get install ppa-purge     ppa-purge ppa:unity-team/staging     sudo apt-get update     sudo apt-get intall --reinstall ubuntu-desktop     sudo apt-get install unity      METHOD 2               cp .config/dconf/user .config/dconf/user.bkp     rm .config/compiz-1/compizconfig/config .config/dconf/user               sudo apt-get install dconf-tools     rm .config/comp-2-1/compiz config/config; dconf reset -f /org/compiz/      Any solutions?


title: mdadm + lvm2: destroyed all superblocks accidentally

text: I accidentally overwrote all my RAID1 superblocks with garbage. I think this happened because I ALT-CTRL-DEL booted when the Ubuntu had put me in some kind of hard disk recovery mode. My display wasn't working and I did this "blind". Looking at my RAID partitions, I see this:               # mdadm --examine /dev/sdc2     /dev/sdc2:               Magic : a92b4efc             Version : 0.90.00                UUID : 00000000:00000000:00000000:00000000       Creation Time : Fri Nov  1 18:59:05 2013          Raid Level : -unknown-        Raid Devices : 0       Total Devices : 1     Preferred Minor : 127              Update Time : Fri Nov  1 18:59:05 2013               State : active      Active Devices : 0     Working Devices : 1      Failed Devices : 0       Spare Devices : 1            Checksum : 6b1f0d22 - correct              Events : 1                     Number   Major   Minor   RaidDevice State     this     0       8       34        0      spare   /dev/sdc2             0     0       8       34        0      spare   /dev/sdc2      It is apparent that the superblocks have been fully overwritten by garbage. Both disks (sdb2, sdc2) look the same, the information is garbage, uuid is all zeros, raid level: unknown, raid devices: 0, etc. The best bet I have is this:               mdadm --create --assume-clean --metadata=0.90 /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sdc2      Can I re-create my RAID array using mdadm --create like this? On the RAID stack, I have an LVM2 physical volume. Can I somehow access my LVM2 data from the individual disks or backup disk images? GRUB is able to find my initrd and kernel image from the disks, /boot is on ext4 root partition filesystem on top of LVM2, it is not a separate partition. So I believe the data is mostly intact, and the superblocks are gone. edit: add --assume-clean to mdadm command line


title: Nautilus special URIs

text: Where are these special URIs used in Nautilus defined in Ubuntu?               recent:///     trash:///     x-nautilus-desktop:///     computer:///     burn:///      These can instantly open special locations in Nautilus by typing them in the path bar. And why doesn't these work when I open Nautilus as root (is first time when I see that root doesn't have privileges to do something)?


title: iterate through files ('for file in...) and also include sub directories?

text: I am using sed to do a bunch of changes to files. I think the question is relevant for any operation that want to iterate through files that match a pattern and include subdirectories both in the original file search recursion AND (i.e. creating them to replicate the structure) in the file creation output I initially get the files with               mkdir -p _seded     for file in *_spec.rb     do       cat $file       ... a bunch of seds       > _seded $file     end      How can I get the files plus _subdirectories_ of files that match the pattern? For instance if I have               spec/ex1     spec/ex2_spec.rb     spec/subs/subex1     spec/subs/subex1_spec.rb     spec/subs/subex2/aaa     spec/subs/subex3/s3_spec.rb     spec/subs/subex4/s4.rb     spec/subs/subex4/bbb      then I should get:               _seded/ex2_spec.rb     _seded/subs/subex1_spec.rb     _seded/subs/subex3/s3_spec.rb      Note: directories subex2 and subex4 should **not** be created as they would be empty. I tried:               mkdir -p _seded     find . -name '*_spec.rb' | xargs cat |       sed -e '[/pattern/replace code]' > _seded/$file      but got errors like:               $ ./convert_should_to_expect.sh      ./convert_should_to_expect.sh: line 5: _seded/: Is a directory     xargs: cat: terminated by signal 13     now doing its !!!     sed: couldn't edit _seded/: not a regular file     awk: cmd. line:1: fatal: cannot open file `_seded/' for reading (Is a directory)     mv: `_seded/tmp' and `_seded/tmp' are the same file     sed: couldn't edit _seded/: not a regular file     sed: couldn't edit _seded/: not a regular file


title: Unset http_proxy enviroment variable

text: > **Updated 11/03** : After doing some test with your suggestions, I only can > be sure about one thing: there is something related to the graphical > environment, because if I login through `ssh` or using a virtual terminal, > the variable is not defined. Any new idea? I have defined in some persistent way the http_proxy variable. Always I open a terminal, I have the http_proxy already defined. This is not my desired behaviour, so I'm looking where I defined http_proxy environment variable. I'm pretty sure that is something user related, because with other users in the same computer I don't have the problem. I have checked the `.bashrc` and other bash-related configuration files, but any of them include the http_proxy variable definition. Obviously, I can `unset` de variable without any problem, but I want to know where the hell is the variable defined. Thanks in advance


title: Manage LXC containers from host in puppet

text: Is there any puppet modules for manage nodes in LXC containers from local host? E.g.: I have host with 50 LXC containers and I want to manage all those containers from host directly, not from another one LXC container with `puppetmaster`.


title: Difference between "blockdev --flushbufs" and "sync" on Linux?

text: **Is there a difference in practice between running`blockdev --flushbufs` and `sync(1)` on Linux?** (apart from `blockdev` flushing for a specific device, and `sync` being system-wide). `sync(1)` manpage says it flushes _file system_ buffers (only?). If do I/O to a drive (with say, `dd`) without going through a file-system layer, is `sync` really ineffectual? When should I use one instead of the other?


title: Which GUI diff viewer would you recommend, with Copy-to-Left/Right functionality?

text: I've hardly ever used anything other than Meld. Can you recommend anything else? It would be extra nice if you give a reason for your recommendation (as a Comment). [ **note** ] I want an alternative because Meld has recently lost the feature to copy _entire_ contents from one file to another. I'm referring to the functionality available via the `Copy To Left/Right` right-click menu item. [ **update** ] I just checked, and the problem was introduced by **1.3.2**. **1.3.1** works well, and the latest I've checked is **1.4.0** , and it doesn't work.


title: Why is `xargs bash -ic echo` not the same thing as `xargs echo` or `xargs`?

text: I expect the command               ls -d doc/* | grep -P "<some_pattern>" | xargs bash -ic echo      to do the same as:               ls -d doc/* | grep -P "<some_pattern>" | xargs echo      that is, to give me the files matched by `ls -d doc/* | grep -P "<some_pattern>"`, only separated by spaces instead of newlines. But I get only a newline as output instead. Why is this? How can I fix the first command to do what I want? By the way, I’m realling using `zsh` instead of `bash`, but neither will work. I actually need this to print a bunch of files whose file names are matched by the pattern specified by "grep" and should be printed using an `.zshrc`-aliased command.


title: TTY1 message help? (with picture)

text: When I boot up , I am greeted with a black TTY1 screen with the following error Kali GNU/Linux 1.0.7 kali tty (screenshot here)               Kali Login:[ 31.695480] brcmsmac: bcma0:0: brcmsmac: brcms_ops_bss_info_changed: associated     [  31.695611] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled:false (implement)     [  31.945313] brcmsmac bcma0:0  brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)      * * * When I press `⏎` (return), it lets me log in and its just left at the terminal. No GUI. This is the first time it ever happened , and before Kali would boot normally.


title: Yum update error: "can't start new thread"

text: I found several posts on this, but none of them work. When I do `yum update`, I get the error **`thread.error: can't start new thread`** ; full stacktrace follows:               [root@ripper234 ~]# yum update     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Traceback (most recent call last):       File "/usr/bin/yum", line 29, in ?         yummain.user_main(sys.argv[1:], exit_code=True)       File "/usr/share/yum-cli/yummain.py", line 309, in user_main         errcode = main(args)       File "/usr/share/yum-cli/yummain.py", line 178, in main         result, resultmsgs = base.doCommands()       File "/usr/share/yum-cli/cli.py", line 345, in doCommands         self._getTs(needTsRemove)       File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs         self._getTsInfo(remove_only)       File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo         pkgSack = self.pkgSack       File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 661, in <lambda>         pkgSack = property(fget=lambda self: self._getSacks(),       File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 501, in _getSacks         self.repos.populateSack(which=repos)       File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack         self.doSetup()       File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup         self.ayum.plugins.run('postreposetup')       File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run         func(conduitcls(self, self.base, conf, **kwargs))       File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook         all_urls = FastestMirror(all_urls).get_mirrorlist()       File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist         self._poll_mirrors()       File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors         pollThread.start()       File "/usr/lib/python2.4/threading.py", line 416, in start         _start_new_thread(self.__bootstrap, ())     thread.error: can't start new thread      I've already tried `yum clean`, that didn't help. My OS is Centos 5.5.


title: Forward all ports SSH

text: I have a question about SSH/Port forwarding. I haven't found the solution anywhere and don't know if there is any. I have a server behind my NAT box at home. I have port forwarding from my NAT box to my server for SSH on port 22. Hence, I connect to `my_nat_public_ip:22` when I'm on the go and it works like a charm. Now I know that I can access any port of my server as well even without configuring my NAT box for it. Indeed, I can just do a dynamic port forwarding like this:               ssh -D 1080 user@my_nat_public_ip      Then connect to port any_port of my server by settings my browser or else to use localhost:1080 as SOCKS proxy, and point to `my_local_server_ip:any_port`. What I would like to do, would be a command like               ssh -D --local_alias=local_alias user@my_nat_public_ip      and if I access local_alias:any_port it forwards to my_server:any_port Would that be possible? Is there any SSH option to do this? It is just plain simpler and makes it possible to have multiple dynamic port forwarding on different servers.


title: Packets do not cross IP tables Postrouting when originating from an external IP

text: I'm trying to reflect traffic from the internet to an internal device that I only want to have local access. I have a host in my DMZ that I'm trying to DNAT traffic to this internal device, and SNAT so no internet route is needed. In testing, I am able to DNAT/SNAT from a local computer to this proxy host and access the resources on the internal device. However when accessing the port on my router, I can see the requests arriving at proxy host via tcpdump, and I see them increment the iptables DNAT rule counter, yet no connection is made. Further more local tests increment both the DNAT and SNAT rule counters, but external traffic only increments the DNAT counter. The proxy host was spun up for only this purpose and has no other services. There is one interface with two IPs .254 and .253, Incoming traffic should come to .254 and be SNAT'd from .253 on its way to the internal device. Kernel IPv4 forwarding is also enabled. Below is my iptables config:               # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *filter     :INPUT ACCEPT [32:4832]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [14:1016]     -A INPUT -p tcp -m tcp --dport 443 -j MARK --set-mark 7     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -i admin -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT     -A INPUT -i admin -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT     -A INPUT -i local -p tcp -m state --state NEW -m tcp --dport 5308 -j ACCEPT     -A INPUT -i admin -p tcp -m state --state NEW -m tcp --dport 10050 -j ACCEPT     -A FORWARD -d 10.254.254.1/32 -p tcp -m state --state NEW,RELATED,ESTABLISHED -mm      tcp --dport 443 -j ACCEPT     -A FORWARD -j ACCEPT     -A INPUT -j ACCEPT     -A OUTPUT -j ACCEPT     COMMIT     # Completed on Sun Jun 22 22:49:18 2014     # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *mangle     :PREROUTING ACCEPT [73:6562]     :INPUT ACCEPT [33:4290]     :FORWARD ACCEPT [18:972]     :OUTPUT ACCEPT [18:1408]     :POSTROUTING ACCEPT [27:1624]     -A INPUT -s 173.214.161.60 -j MARK --set-xmark 0x6/0xffffffff     -A FORWARD -s 173.214.161.60 -j MARK --set-xmark 0x5/0xffffffff     -A POSTROUTING -s 173.214.161.60 -j MARK --set-xmark 0x4/0xffffffff     -A PREROUTING -s 173.214.161.60 -j MARK --set-xmark 0x3/0xffffffff     -A OUTPUT -s 173.214.161.60 -j MARK --set-xmark 0x2/0xffffffff     COMMIT     # Completed on Sun Jun 22 22:49:18 2014     # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *nat     :PREROUTING ACCEPT [31:3139]     :POSTROUTING ACCEPT [14:1016]     :OUTPUT ACCEPT [14:1016]     -A PREROUTING -d 10.254.254.254/32 -i dmz -j DNAT --to-destination 10.254.254.2     -A POSTROUTING -o dmz -j SNAT --to-source 10.254.254.253     COMMIT     # Completed on Sun Jun 22 22:49:18 2014


title: AWK - a question about columns

text: I have a question. I was trying to deal with it by myself, but it seems like I am too new in `awk` to make it work. Let's assume that we have a file (eg. database.txt) (values are tab- separated):               NA64715 YU24921 MI84612 MI98142 NA94732         3241531 4957192 4912030 6574918 0473625          0294637 9301032 8561730 8175919 8175920          9481732 9359032 8571930 8134983 9385130          9345091 9385112 2845830 4901742 3455141           In a separate file (eg. `populations.txt`) I have information about which ID belongs to which group, eg.:               NA64715 Europe         YU24921 Europe         MI84612 Asia         MI98142 Africa         NA94732 Asia          What I need to do is to force `awk` to create separate files with columns for all groups (Europe, Asia, Africa). The file I need to work on is huge, so I cannot simply count and number columns and do it the easy way. I need `awk` to check which ID belongs to which population (Europe etc.), then find that particular column in a database file, and then copy a whole column to a new file (separate for all the populations). The result should look like: File 1 (`europe.txt`):               NA64715 YU24921          3241531 4957192          0294637 9301032          9481732 9359032         9345091 9385112            File 2 (`asia.txt`)               MI84612 NA94732         4912030 0473625         8561730 8175920         8571930 9385130         2845830 3455141          File 3 (`africa.txt`)               MI98142          6574918         8175919         8134983         4901742          Can anyone help me with this issue?


title: kvm_open: cannot open /proc

text: I have 100+ boxes running FreeBSD 8.4 amd64 RELEASE (p9) with the same configuration. And only one of them sometimes behaves strangely: load average (generally 4~6, it's ok course box have 8 CPU cores) grows up to 30-40, system running slow and `top` starts to print `kvm_open: cannot open /proc/[some_numbers]/mem` messages. When load average goes down, such messages not appears anymore. The question is not how to fight with high la, but what does `kvm_open: cannot open /proc` mean? System does not running out of memory, as I see.


title: SSL no certificate

text: I'm trying to make a bash script who will check the SSL status of my web site client and return the error. But for every IP, `wget https://$ip:$port` gives me the following error:               ERROR: The certificate of 1.2.3.4 is not trusted     ERROR: The certificate of 1.2.3.4 hasn't got a know issuer      When I try with Firefox I have the certificate for each IP. So I tried to dump the Firefox CA to a repository like this:               wget http://$ip:$port --ca-directory=(directory of CA from Firefox)      But it doesn't change anything. I think, `wget` doesn't find SSL certificate and I don't know to get them. How can I get the certificate information?


title: Can VirtualBox return IP address for launched VM?

text: I would like to start my VM from the command line and without the GUI using the following command: `VBoxManage startvm <MY_VM> \--type headless` and the SSH into it from the next prompt. The problem, however, is that my laptop is on office WiFi, which uses DHCP, so the IP address assigned to the VM instance changes almost every time. When I launch the GUI, I can fetch the IP and then close it and SSH into it, however, I find this step rather annoying and seemingly needless (or should be). Is there any way to have the `VBoxManage` utility return the IP address for the newly launched instance, which I would then use to SSH into it? I shall add that I have used `Vagrant` to launch `VirtualBox` which circumvents the need for IP (just do `vagrant ssh`) but Vagrant has some other oddities I would like to avoid, i.e. use bare `VirtualBox`.


title: How to make awesomewm textclock reflect timezone change?

text: I am using the `awful.widget.textclock` widget to display the time in Awesome WM on Arch Linux, and I am using a program called `tzupdate` to automatically update my system time according to geolocation periodically. I travel frequently, so I thought it would be nice to automate this. However, the textclock widget does not change the time unless I restart Awesome (or relog/restart). Is there something I could add in the lua script to make the widget refresh the timezone? `tzupdate` is working fine. I have it on a `systemd` timer that updates the timezone every five minutes. The system's timezone is successfully changed in this way. The output of `timedatectl` immediately shows the updated timezone, and the output of the date command correctly displays the correct updated local time. However, as noted above, Awesome fails to notice this timezone change until I restart (`Ctrl``Mod``R`) or logout.


title: Solving "mv: Argument list too long"?

text: I have a folder with more than a million files that needs sorting, but I cant really do anything because `mv` outputs this message all the time               -bash: /bin/mv: Argument list too long      I'm using this command to move extension-less files:               mv -- !(*.jpg|*.png|*.bmp) targetdir/


title: Why do I get one more number of bytes reported in a file?

text: Why do I get one byte more reported? I do not have a newline at the end. I tested other files with similar result. Using linux 3.2.               $ cat testfile.txt      aabbcd          $ wc -c testfile.txt      7 testfile.txt      Similarly I get one more number of bytes reported if I use c++:               ...     file(filename, std::ifstream::in | std::ios::binary);     file.seekg(0, std::ifstream::end);     int fsize = file.tellg();     ...      The text aabbcd consist of 6 characters, in ASCII encoding that should be 6 bytes. Why do I get 7 bytes reported? Note: I happend to have characters in the example, but I care only about the bytes, not text, not formatted input.


title: Batch rename files with unknown names and unknown extensions

text: I have a bunch of pictures, some are `.jpg`, some are `.png`. any given picture could have an entirely random name (possibly including spaces). in any given directory, how can I rename all of them, while keeping the extension as is? the input, for example:               001.jpg     02.png     05.png     zzzz.jpg      I would like to completely replace their names with four-digit numbers, starting with `0001`, and going up to `9999` (if necessary). thus, the output might look like:               0001.jpg     0002.png     0003.png     0004.jpg      the order of these files is important to me, but they are already in sequential order if I were to sort them by filename alone. I have checked out the perl `rename`, and its usage is a mystery to me in this example.


title: Using makefile assignments from a shell script

text: For example:               srcdir = ../libc  # Src directory     prefix = /usr/local           // Installation path       The first line is from a makefile and second from `config.make`. I need to access the variable in a shell script as `$srcdir` and `$prefix`. One solution I found is cutting all `` = `` to ``=`` and the part after `#` and `//` and do `eval`. Is there any other easy and reliable solution? I am on `#!/bin/sh`.


title: can you make zsh autocorrect smarter?

text: I like `zsh` autocorrect, but it keeps asking me about things that don't need correcting.               dzil build     zsh: correct 'build' to '.build' [nyae]? %       `.build` is a directory created by the `build` (or any other commands that run that action so `dzil .build` is always wrong, and `dzil build` is always right. Is there any way I can communicate this to the autocorrect system?


title: Building GDB, cant find libreadline.a

text: I am trying to build GDB from source, and am encountering a strange problem. I'm not sure what information is relevant, so please let me know if I have not provided enough. I am working on Linux Mint. I have a tarball of the various gdb source files and build scripts, which was provided in a class. When executing one of the build scripts (linux-targ), which I can post if it's valuable, I encounter the following error.               .../gdb/install.sh -c -m 644 libreadline.a /usr/local/lib/libreadline.a       install:  libreadline.a does not exist       make[1]:  [install] Error 1        This is the line in the install.sh script that is failing.                   if [ -f $src -o -d $src ]           then                   true           else                   echo "install:  $src does not exist"                   exit 1           fi        I've tried copying a libreadline.a to the local directory, but that failed also. However, `/usr/local/lib/libreadline.a` does exist. I have even removed it and reinstalled. It also doesn't seem to matter if I run this as root. Why is the install script reporting that `libreadlines.a` does not exist? If this is the wrong SE, please suggest an alternative.


title: Flash video in full screen adapts primary screen's size all ways

text: This is a dual monitor setup with, Primary Screen - 1366x768 and Secondary Screen - 1280x1024. Whenever a flash video from YouTube or some site is played in Secondary Screen to full screen it scales to resolution of the Primary Screen. Things that i have already tried,   1. Flash fullscreen on secondary (bigger) screen doesn't work


What is the Linux command to display how many file names in the directory end in two digits? Using `ls` with a command like this :               ls -l | wc –l  *[0-9][0-9]


title: To bold one line with Perl regex

text: I have               1. Lorem     He he he          % not sure spelling     2. Lorem      ipsun      I want to have               \textbf{1. Lorem}     He he he          % not sure spelling     \textbf{2. Lorem}     ipsun      My pseudocode attempt               perl -000pe 's/\n\n\d./; s/\n\d.\n\\textbf\{ /g; s/$/\}/'      which is based on my two previous questions about regex here. I try to match the thing which starts with a number. Replace the beginning of the match and the end of the match. The code gives me               Backslash found where operator expected at -e line 1, near "s/\n\n\d./; s/\"     Backslash found where operator expected at -e line 1, near "n\"     Backslash found where operator expected at -e line 1, near "n\"     Backslash found where operator expected at -e line 1, near "textbf\"     Backslash found where operator expected at -e line 1, near "$/\"         (Missing operator before \?)     syntax error at -e line 1, near "s/\n\n\d./; s/\"     Execution of -e aborted due to compilation errors.      **How can you bold the given text?**


title: How to combine iptables rulesets

text: Say there are several iptables scripts (run at boot time), all of which run something like `iptables -A ...` to add rules. I'm thinking this could be improved, turning all those shell scripts into text files generated by iptables-save. But I must be doing something wrong, trying to read all those rulesets. The script run at boot time would loop through those files and read them using iptables-restore. Of course with -n or --noflush. This works for some rules (stored in the default chains) but not for most of my rules which are in other chains. Below is an example of 2 rulesets that flush each other (reading set a, check; reading set b, check but set a is gone). **How would you read a bunch of iptables rulesets?** Example:               $ cat fake1-a.rules      *nat     :PREROUTING ACCEPT [7:997]     :INPUT ACCEPT [7:997]     :OUTPUT ACCEPT [28:1810]     :POSTROUTING ACCEPT [28:1810]     COMMIT     *mangle     :PREROUTING ACCEPT [344:84621]     :INPUT ACCEPT [344:84621]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [296:37971]     :POSTROUTING ACCEPT [296:37971]     COMMIT     *filter     :INPUT ACCEPT [102:26513]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [89:10767]     :TESTCHAIN - [0:0]     -A TESTCHAIN -p tcp -m tcp --dport 12345 -j DROP     COMMIT     $ cat fake1-b.rules      *nat     :PREROUTING ACCEPT [7:997]     :INPUT ACCEPT [7:997]     :OUTPUT ACCEPT [28:1810]     :POSTROUTING ACCEPT [28:1810]     COMMIT     *mangle     :PREROUTING ACCEPT [344:84621]     :INPUT ACCEPT [344:84621]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [296:37971]     :POSTROUTING ACCEPT [296:37971]     COMMIT     *filter     :INPUT ACCEPT [102:26513]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [89:10767]     :TESTCHAIN - [0:0]     -A TESTCHAIN -p tcp -m tcp --dport 54321 -j DROP     COMMIT     # cat fake1-a.rules | iptables-restore --noflush     # iptables -nL | grep DROP     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:12345     # cat fake1-b.rules | iptables-restore --noflush     # iptables -nL | grep DROP     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:54321


I'm using ubuntu 12.10 for my MPI(message passing interface) configuration I have installed mpd after installation I have start mpd, it is started normally no error message display but when I'm trying to run the command "mpd &" it gives me error message "Failed to bind to '127.0.0.1:6600': Address already in use" I have tried many solutions but the result is same.               root@ub0:~# service mpd start          Starting Music Player Daemon mpd     [ OK ] root@ub0:~# service mpd restart          Stopping Music Player Daemon mpd     [ OK ] Starting Music Player Daemon mpd     [ OK ] root@ub0:~# mpd &          [1] 2881 root@ub0:~# Failed to bind to '127.0.0.1:6600': Address already in use          [1]+ Exit 1 mpd


title: iptables - add rule for interface before it comes up

text: Right now I'm using /etc/rc.local to add some iptables rules on my Linux router on boot however some of the rules aren't added. I assume this is because the interface hasn't come up yet. This is what I have in there:               sudo /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE     sudo /sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT     sudo /sbin/iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT      I think the ppp0 interface must take a while to come up on boot and iptables might refuse to add the rule since the ppp0 interface doesn't exist. Is there a way to force iptables to add the rule anyway? I thought I would check this before I introduce a loop into the script to wait for the interface to exist before adding the rules. I've also observed iptables doesn't remove the rule when the interface disappears and comes back after the rule was already added (which is good behaviour in my case).


title: Script: Running a second process when the firts ended

text: I am trying to make a script that consist in a two parts. the first one is to run a initial state and the second one is to equilibrating the system. The problem is that the second is dependent of the first so i need the first process to be ended before i run the second one. How can i do that? the code that i'm running is the following:               #!bin/sh          echo -n  "Imput Chemical Potential:"     read chem     awk < towhee_input -v n="-$chem" 'NR==12 {$0=n}{print}'> towhee_input1     echo -n  "Imput nstep initial:"     read nstepi     r=5     declare -i p     pi=$nstepi/$r     awk < towhee_input1 -v k="$nstepi" 'NR==18 {$0=k}{print}'> towhee_input2     awk < towhee_input2 -v t="$pi" 'NR==22 {$0=t}{print}'> towhee_input3     awk < towhee_input3 -v t="$pi" 'NR==24 {$0=t}{print}'> towhee_input4     awk < towhee_input4 'NR==82 {$0=".true."}{print}'> towhee_input5          ##### (i wont that process finish first and then continue the script)     towhee towhee_input5 > output &       ##### (i wont that process finish first and then continue the script)          cp towhee_final towhee_initial     echo "Run again?"     read wwwww          u=5     declare -i nstep     nstep=$nstepi*$u     declare -i p     p=$pi*$u     awk < towhee_input5 -v k="$nstep" 'NR==18 {$0=k}{print}'> towhee_input6     awk < towhee_input6 -v t="$p" 'NR==22 {$0=t}{print}'> towhee_input7     awk < towhee_input7 -v t="$p" 'NR==24 {$0=t}{print}'> towhee_input8     awk < towhee_input8 'NR==82 {$0=".false."}{print}'> towhee_input9     towhee towhee_input9 > towhee.prod &      how can I accomplish that ?


title: How to add aac and libx264 to FFmpeg installation?

text: I've already installed FFmpeg according to the ffmpeg Ubuntu compile guide. I can't use aac audio encoding and libx264, which I need. How do I install FFmpeg so that all the option below are enabled in the installation? Do I need to uninstall FFmpeg and start over again, or can I just add to what has already been installed?


title: Is there a command to list the compressed file sizes for files within a .zip file?

text: I'd like to see the absolute size in bytes of each file that has been compressed into single zip file. Having read the zip man page, I'm not sure that that utility can do it. This is on Mac OS X. Something like:               $zip list myarchive.zip          file1.jpg 100 bytes compressed 3000 bytes uncompressed     file2.jpg 130 bytes compressed 3440 bytes uncompressed


title: Is there a way to make tail -F beep?

text: Is there a way to make `tail -F` or `less` beep (ring the bell in a terminal) when new data comes in (a new line is added to the file). Or is there any other unix utility to do this on a linux or mac.


title: change sftp to ftp

text: I recently installed a CentOS machine for a couple of game servers. I followed some tutorials on the web for that, because I'm a linux noob. But. I want to `sftp` to store data on the server but it is very slow, I read that `ftp` is much faster. So my question is: Can I change my SFTP to a FTP server and if so, how.


title: Backing up files which were modified after the last backup was run

text: I am working on a backup script (bash shell - Fedora - VMware) that should compare a file with last modified attribute and current date and should back it up if the last modified date is older than the last run of the script. I have tried couple of things (awk,stat and grep) however i could not make something which enables the comparison and lets the script decide if the files should be backed up or not. Please focus on 2 case statement.               #! /bin/sh     echo "welcome to backup pro"     echo -e  "\n 1:Full \n 2:Incremental"     echo "Enter your choice"       read choice     echo "Enter the files to be backup"       read filetype     echo "Enter the destination folder"       read destination       case $choice in          1)           echo "The selected backup type is Full backup"           echo "Backing up $filetype files.."           sleep 1           cp *.$filetype /home/uone/backup_folder           tar -zcvf archive_backup_folder.tar.gz backup_folder/   2>full-error.log           mv archive_backup_folder.tar.gz /home/uone/backup_folder; cd /home/uone/backup_folder ;     rm *.$filetype           sleep 1           tail full-error.log           break         ;;         2)           echo "The backup you chose is Increment"           ls -l | awk 'END {print $9 "\t" $8}'           b=data "%H%M%S"                if [ $a -lt  $b ];                then               echo "This is under construction"             fi         ;;       esac     exit 0


title: Error while loading shared libraries

text: My project tree looks something like that:               src/     include/     Makefile     lib/        lib/3rdparylib/      I didn't code `3rdpartylib`, but decided to embed its source code in my project packaging. I compile the software by doing the following steps:               $ cd lib/3rdpartylib/     $ make     $ ln -s 3rdpartylib.so.0 3rdpartylib.so      Then I compile each of **my** source files like this:               $ gcc -c src/file.c -I include -o file.o -l 3rdparylib -L lib/3rdpartylib -I lib/3rdpartylib/include      Then I link:               $ gcc file1.o file2.o -l3rdpartylib -L lib/3rdpartylib -o myapp      When I am on my main machine, it works perfectly. Today I tried to launch it on another machine. It compiled and linked without any problem. However when I tried to launch the application I got the following error message. ./myapp: error while loading shared libraries: 3rdpartylib.so.0: cannot open shared object file: No such file or directory I tried doing the following:               export LD_LIBRARY_PATH=/path/to/3rdpartylib.so      It seems to work. But I understand that using LD_LIBRARY_PATH is a bad practice. It bothers me to have this variable set up every time I want to run my app. What am I missing? Why does it work on my main machine (where LD_LIBRARY_PATH is not set to anything) and not on the other machine? Does it matter that the other machine is a virtual one? If it is of any help, my main machine is a Debian box, and my "new" machine is a Sabayon (Gentoo), running in Virtualbox.


title: How do I start a virtual machine in background upon OSX system start?

text: I have a virtualbox machine on a OSX 10.9.2 host. I do not want to open VirtualBox everytime and start the machine there. Also, I do not need the the screen output as I will just ssh from OSX terminal anyway. How to start the virtual machine in headless mode on system start?


title: Redirecting stdin with stdout to file

text: So I have a program that takes in user input and outputs text based on the input. EDIT2: I want to create a script that runs a C executable and the script feeds the C program input from a file and redirect output to another file. HOWEVER I want to also print out the input whenever an output was printed for input basically combining/merging the input and output together. So I feed it input line by line in a file and then print output to a file for every input and I keep doing this. I do not want to re-run the program I want the program to still be running until it reaches the end of the input file or until I send it a kill signal from the script. (I'm trying to make a grading script for a class. Students submit their programs and I run this script and I feed input to their programs but I want to keep track of the input + output together so it makes it easier for me to keep track of the input for each of their output) I can figure out how to create the rest of the script myself but I'm just stuck at combining input + output together. Edit3: I don't think expect will work because I have no way of knowing what the program will output. I only know what it's suppose to take in. For example one student might have a program say "Give me a character:" while another will say "Enter a char-" so I don't know what to expect from these programs. (Note: I will have many different executable that will have different format but should all ask for same amount of input) For example, one of the executable could be this:               "Enter a number: " (Wait for user input)     "Give another: "  (Wait for user input     "Total: " (Output based on input)     "Do you want to run again? "(Wait for user input)      EDIT: My main goal of my script is to run the program taking in input from a file line by line. For example for this program I will want it to take in the file "input" as stdin but I also want to keep track of the stdin merged with the stdout. So I know ./a.out < input > output will output               Enter a number:      Give another:       Total:  15     Do you want to run again?       However it's missing the input which is what I want included also so I can tell what the input was based on the output just by looking at the output file ONLY because the input could be 7 8 N or 5 10 N or anything like that. Edit4: Solved!!! Answer - by Stephane Chazelas               mkfifo strace.fifo     {       while read -d, trace; do         if [[ $trace = *"read(0" ]]; then           IFS= read -rn1 answer <&3           answer=${answer:-$'\n'}           printf %s "$answer" >&2           printf %s "$answer"         fi       done < strace.fifo 3< input.txt |        strace -o strace.fifo -e read stdbuf -o0 ./a.out     } > log 2>&1


title: Make some fields required in dialog

text: The script below creates a dialog box. The user can press `Enter` at any time, and then the script continues. I need to block the `Enter` key to ensure that the user fills all the fields. How can I do that?               #!/bin/bash     shell=""     groups=""     user=""     home=""     exec 3>&1     dialog --separate-widget $'\n' --ok-label "Ok" \               --backtitle "Linux User Managment" \               --title "new" \               --form "creating new " \     15 80 0 \             "field1: "              1 1 "$user"             1 25 40 0 \             "field2:"               2 1 "$shell"            2 25 40 0 \             "field3:"               3 1 "$groups"           3 25 40 0 \             "field4:"               4 1 "$home"             4 25 40 0 \          # aggiungi dimensione quota          2>&1 1>&3 | {       read -r user       read -r shell       read -r groups       read -r home            echo $user       echo $shell       echo $groups       echo $home            #continue script here     }     exec 3>&-      ![enter image description here](http://i.stack.imgur.com/00IyG.png)


title: How to copy partioning information with dd?

text: I am trying to recover partitioning information using TestDisk. To try things out I copied all data from the original harddisc to another physical drive using dd as follows:               $ dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror,sync      Running TestDisk on the original drive shows up like this:               Disc /dev/sda - 500 GB / 465 GiB - CHS 969021 16 63          Warning: the current number of heads per cylinder is 16     but the correct value may be 255     You can use the Geometry menu to change this value.     It's something to try if     - some partitions are not found by TestDisk     - or the partition table can not be written because partitions overlaps.      And after continuing without changing anything "Quick analyze" outputs:               Disk /dev/sda - 500 GB / 465 GiB - CHS 969021 16 63          Partition             Start        End    Size in sectors      * HPFS - NTFS               2   0 33    205   3 19     204800 [System-reserviert]      P HPFS - NTFS             205   3 20 203174   9 41  204593152 [W764]      P Linux                203176  10 11 305359   3 51  103000064      L Linux                313112   6  7 373707   2 50   61079552        HPFS - NTFS          373707   2 51 969022  15 47  600078336 [DATA]        HPFS - NTFS          373707   2 58 969020  15 63  600076329      Running TestDisk "Quick analyze" on the test drive show up like this:               Disk /dev/sdb - 500 GB / 465 GiB - CHS 969021 255 63          Partition             Start        End    Size in sectors        HPFS - NTFS               0  32 33     12 223 19     204800 [System-reserviert]        HPFS - NTFS              12 223 20  12748  53 41  204593152 [W764]        Linux                 12748  86 11  19159 202 51  103000064        Linux                 19646  68  7  23448  74 50   61079552        HPFS - NTFS           23448  74 51  60801 112 47  600078336 [DATA]      The discs are not by the same brand. The test drive is a SSD. It seems as if the partitioning information is not copied to the test drive. Why? * * * The output of _sfdisk_ is the same for both discs. Here for `/dev/sda`:               $ sudo sfdisk -d /dev/sda     # partition table of /dev/sda     unit: sectors          /dev/sda1 : start=376696782, size=600076386, Id= 7, bootable     /dev/sda2 : start=        0, size=        0, Id= 0, bootable     /dev/sda3 : start=        0, size=        0, Id= 0, bootable     /dev/sda4 : start=        0, size=        0, Id= 0, bootable      Here is the output of _parted_. The disc model differs - the other data is the same:               $ sudo parted /dev/sda print     Model: Disk Name (scsi)     Disk /dev/sda: 500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start  End    Size    Type     File systems  Flags      1      193GB  500GB  307GB  primary  ntfs          boot      * * * The geometry (as seen by the kernel) for the S-ATA disc ...               $ sudo sfdisk -g /dev/sda     /dev/sda: 969021 cyclinders, 16 heads, 63 sectors/track      ... and for the SSD disc               $ sudo sfdisk -g /dev/sdb     /dev/sdb: 60801 cyclinders, 255 heads, 63 sectors/track


title: Why dircolors don't return enything for bash called from php

text: I have this code in php:               header("Content-Type: text/plain");     exec("/bin/bash -c 'dircolors -b'", $result);     echo implode("\n", $result);      but it return               LS_COLORS='';     export LS_COLORS      Why I'm not getting color ANSI codes?


title: Does Posix require any devices?

text: Does Posix require any devices? For example, `/dev/urandom`, `/dev/zero` or `/dev/null`? I suspect not because of non-*nix OSes, but wanted to ask for completeness.


title: Assigning a global hotkey to a functionality of an appilcation in KDE

text: How can I set global shortcut keys to `Pause` and `Record` buttons in `audacity`? Options of `vlc` allow assigning global hotkeys but there's not such options in `audacity`.


title: MYSQL : Connecting to mysql from : 127.0.0.1 + telling ip tables to allow only 127.0.0.1 for mysql port : Logic vs Common Sense

text: > If i make 1 billion or 1 trillion queries to MYSQL database from 127.0.0.1 > via port 3306. vs > If i make same amount of queries to MYSQL database also from 127.0.0.1 via > port 3306. but with a difference thing. In this case I would have this rule in `iptables`:               -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -s 127.0.0.1 -j ACCEPT      rather than the regular..               -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT        * Can there be any speed consequences ?    * Can there be any efficiency consequences ? Because human mind says: > how can there not be a consequence if it has to be verified by the iptables > that it actually is 127.0.0.1 and not some other İP address that is trying > to establish a connection "