Bash script for opening screens and compiling the same file

I have written a bash script to initiate separate screen sessions and run a command in each of them that compiles the same `C++` source file in `ROOT` (an object-oriented data analysis framework http://root.cern.ch/drupal/content/about) in every screen session. It worked fine at the beginning; however as the compilation time increased(as an observation) it failed to compile and numerous errors were produced. The error message inside the text file is below:               Info in <TUnixSystem::ACLiC>: creating shared library /DIRECTORY/./readerSummerStd_C.so     ACLiC:0: RuntimeWarning: Failed to generate the dependency file for /DIRECTORY/./readerSummerStd_C.so     Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:     g++: /DIRECTORY/readerSummerStd_C_ACLiC_dict.o: No such file or directory     Error in <ACLiC>: Compilation failed!     Traceback (most recent call last):       File "./NEWrunReader.py", line 87, in <module>         from ROOT import readerSummerStd as reader     ImportError: cannot import name readerSummerStd      The analysis zsh script is provided below for reference, if I wait for one code to compile and then run the other code no problem occurs. How can I circumvent this problem?                   #! /bin/zsh         ### Script for running everything in screens ###         echo You have the following screens running:         screen -ls         echo Press any key to proceed. NOTE THAT YOUR OTHER SCREENS WILL GET KILLED!         read         pkill -15 -U arisevon screen ## We make sure that no screens are running for now         bkgarr=(TopJets BosonJets DiBoson TTbar)         sigarr=(NM1 NM2 NM3 Scenario4 Scenario6)         puarr=(50PU 140PU)         lumarr=(30 300 3000)              echo Please type 1 for 50PU samples and 2 for 140PU samples         read PU         if [[ $PU -ne 1 && $PU -ne 2 ]] ; then             echo You have to enter 1 or 2             return 1         fi              echo Please type 1 for 300fb-1 and 2 for 3000fb-1         read lum              if [[ $lum -ne 1 && $lum -ne 2 ]] ; then             echo You have to enter 1 or 2             return 1         fi              if [ $PU = 1 ]; then             let "lum = $lum + 1"             #echo $lum         fi              ex NEWrunReader.py  <<EOEX           :43s/Lumi.*/Lumi=$lumarr[lum]/           :x         EOEX              echo Press any key to proceed or Ctrl+C to abort!         read         for index in $bkgarr         do             screen -dmS $index             screen -S $index -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'             screen -S $index -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$index >& $index.txt &"$'\r'         done         for sigind in $sigarr         do             screen -dmS $sigind             screen -S $sigind -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'             screen -S $sigind -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$sigind >& $sigind.txt &"$'\r'         done         return 0      These codes are for performing an analysis in high energy physics and I am really curious as this script worked flawlessly before. The only difference is that there is that the C++ source code got more complex than before. The Python code is as follows:               #!/usr/bin/python               import sys     from ROOT import gROOT          # scenarios and samples     scenarios = ['NoPU','50PU','140PU']     #scenarios = ['140PU']     ########################################################     # FOR THE PAPER (SNOWMASS)     #samples   = ['DiBoson','BosonJets','TopJets','TTbar','TDR4','TDR5','TDR6','TDR8','naturalSUSY']     ########################################################     #samples   = ['TTbar']     # by historic reason we have as dir names: bjets  diboson  tdr tdrNew tjets  ttbar for snowmass     # by historic reason we have as dir names: bjets  diboson  tdr        tjets  ttbar for snowmass2     #for (ecfa) PhaseII_C3 / C4v2     ########################################################     #samples w.o weight (snowmass)     #noWeight  = ['TDR4','TDR5','TDR6','TDR8','naturalSUSY']          # nTuple input path     #########################################################     # for susyhit     samples   = ['DiBoson','BosonJets','TopJets','TTbar','NM1','NM2','NM3','Scenario6','Scenario4','Scenario1']     noWeight  = ['NM1','NM2','NM3','Scenario6','Scenario4','Scenario1']     base = '/nfs/dust/cms/user/safarzad/Output/EOSforFutureStudies/14TeV/PhaseII/Configuration4v2/140PileUp'     #########################################################     # for naturalSUSY     #base = 'nTuples/ECFA/PhaseII_C3'     #base = 'nTuples/ECFA/PhaseII_C4'     #########################################################     # FOR THE PAPER (SNOWMASS)     #base = 'nTuples/snowmass2'     #########################################################     # for PhaseII_C3 & PhaseII_C4v2 (ecfa) #################  !!!!!!!!! #####################     #base = 'Output/ECFA/PhaseII_C3' #### noch per Hand aendern, besser in scenarios C3, C4 beruecksichtigen! ####     #base = 'Output/ECFA/PhaseII_C4v2'     #base = 'Output/14TeV/'     #     #     # lumi in fb^-1     Lumi=30               def help():         print 'First argument analysis:'         print '   SingleS'         print ' then a list of inputs - read the code'         sys.exit(0)          from operator import mul     def scale(fac,list):         return map(mul,len(list)*[fac],list)          # choose the analysis and a sample     if len(sys.argv)>1:         if sys.argv[1]=='SingleS':       # single lepton  stop - CMS             gROOT.LoadMacro('readerSingleS.C+')             from ROOT import readerSingleS as reader         if sys.argv[1]=='Claudia_task':       # single lepton  stop - CMS             gROOT.LoadMacro('readerClaudia_task.C+')             from ROOT import readerClaudia_task as reader         elif sys.argv[1]=='Skeleton':  # SKELETON             gROOT.LoadMacro('readerSkeleton.C+')             from ROOT import readerSkeleton as reader         elif sys.argv[1]=='SingleSOld':  # single lepton testing version              gROOT.LoadMacro('readerSingleSOld.C+')             from ROOT import readerSingleSOld as reader         elif sys.argv[1]=='SingleS_P':  # single lepton testing version              gROOT.LoadMacro('readerSingleS_P.C+')             from ROOT import readerSingleS_P as reader         elif sys.argv[1]=='SingleSDelphMET':  # single lepton testing version              gROOT.LoadMacro('readerSingleSDelphMET.C+')             from ROOT import readerSingleSDelphMET as reader         elif sys.argv[1]=='EWKino':  # EWKino             gROOT.LoadMacro('readerEWKino.C+') # used to be EWKinoNew             from ROOT import readerEWKino as reader         elif sys.argv[1]=='AtlasH_Sb':  # Exc             gROOT.LoadMacro('readerAtlasH_Sb.C+') # used to be EXc             from ROOT import readerAtlasH_Sb as reader         elif sys.argv[1]=='AtlasH':  # Atlas hadronic             gROOT.LoadMacro('readerAtlasH.C+') # used to be ?????             from ROOT import readerAtlasH as reader         elif sys.argv[1]=='SummerStd':  #             gROOT.LoadMacro('readerSummerStd.C+') # used to be ?????             from ROOT import readerSummerStd as reader         else:              help()     else:          help()               #prepare empty dictionaries     do={}     for scene in scenarios:         do[scene]={}         for samp in samples:             do[scene][samp] = 0     # read input line and set flags what to process     flag=False     for e in sys.argv:         for scene in scenarios:             for samp in samples:                 if e==scene+'_'+samp:                      do[scene][samp] = 1                     if scene=='140PU': Lumi=Lumi*10  # lumi*10 for 140PU                     flag=True     if not flag: help()               # prepare empty dictionaries     dirsHT={}     inDir={}     weights={}     for scene in scenarios:         inDir[scene]={}     #   weights[scene]={}               ### for PhaseII_C3 / C4v2 ((from ecfa)) ONLY TTbar                    #--------------------------------------------- sample properties for processing <<<<<<<<<<<<<<<<<<<<<<<<<<<     #                                               I:  HT dirs, xsecs --> 33TeV     #                                              II:  HT dirs, xsecs --> 14TeV     #------------------------------------------------ diboson     # HT dirs      #I:dirsHT['DiBoson']  = ['0-400/','400-1000/','1000-2000/','2000-3400/','3400-100000/']     dirsHT['DiBoson']  = ['0-300/','300-700/','700-1300/','1300-2100/','2100-100000/']     #    xsec     #I:weights['DiBoson'] = [776.00399, 106.85023, 10.16835, 0.86136, 0.09507]     weights['DiBoson'] = [249.97710, 35.23062, 4.13743, 0.41702, 0.04770]     #    multiply all by lumi     weights['DiBoson'] = scale(Lumi,weights['DiBoson'])     #     # NoPU     inDir['NoPU']['DiBoson']  = base+'/NoPU/diboson/'     # 50PU     inDir['50PU']['DiBoson']  = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/diboson/'      # 140PU     #inDir['140PU']['DiBoson'] = base+'/diboson/'          inDir['140PU']['DiBoson'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/1st_Output/PhaseII_140PU_ProdJul28/diboson/'     #'/140PU/diboson/'     #     #------------------------------------------------ boson+jets     # HT dirs      #I:dirsHT['BosonJets']  = ['0-400/','400-1000/','1000-1800/','1800-3000/','3000-4600/','4600-6600/','6600-100000/']     dirsHT['BosonJets']  = ['0-300/','300-600/','600-1100/','1100-1800/','1800-2700/','2700-3700/','3700-100000/']     #    xsec     #I:weights['BosonJets'] = [129824.79383, 6598.37529, 325.55814, 32.45249, 3.16778, 0.32737, 0.04045]     weights['BosonJets'] = [34409.92339, 2642.85309, 294.12311, 25.95000, 2.42111, 0.22690, 0.02767]     #    multiply all by lumi     weights['BosonJets'] = scale(Lumi,weights['BosonJets'])     #     # NoPU     inDir['NoPU']['BosonJets']  = base+'/NoPU/bjets/'     # 50PU     inDir['50PU']['BosonJets']  = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/bjets/'      # 140PU     inDir['140PU']['BosonJets'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/bjets/'     #inDir['140PU']['BosonJets'] ='/nfs/dust/cms/user/safarzad/Output/EOSforFutureStudies/14TeV/PhaseII/Configuration4v2/140PileUp/bjets/'     #inDir['140PU']['BosonJets'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Output/delphes/ProdJun14/bjets/'     #base+'/bjets/'     #'/140PU/bjets/'     #     #---------------------------------------------- ttbar     # HT dirs      #I:dirsHT['TTbar']  = ['0-600/','600-1200/','1200-2000/','2000-3200/','3200-4800/','4800-100000/']     dirsHT['TTbar']  = ['0-600/','600-1100/','1100-1700/','1700-2500/','2500-100000/']     #    xsec     #I:weights['TTbar'] = [3438.70635, 505.82210, 61.81892, 7.65752, 0.72643, 0.07147]     weights['TTbar'] = [530.89358, 42.55351, 4.48209, 0.52795, 0.05449]     #    multiply all by lumi     weights['TTbar'] = scale(Lumi,weights['TTbar'])     #     # NoPU     inDir['NoPU']['TTbar']  = base+'/NoPU/ttbar/'     # 50PU     inDir['50PU']['TTbar']  = '/nfs/dust/cms/user/clseitz/Delphes/FILES/PhaseI_50PU_ProdAug6/ttbar/'      # 140PU     inDir['140PU']['TTbar'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/ttbar/'     #inDir['140PU']['TTbar'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Output/delphes/ProdJun14/ttbar/'     #inDir['140PU']['TTbar'] = base+'/ttbar/'     #'/140PU/ttbar/'     #     #--------------------------------------------- tjets     # HT dirs      #I:dirsHT['TopJets']  = ['0-600/','600-1200/','1200-2200/','2200-3600/','3600-100000/']     dirsHT['TopJets']  = ['0-500/','500-1000/','1000-1600/','1600-2400/','2400-100000/']     #    xsec     #I:weights['TopJets'] = [493.50469, 23.51848, 1.97369, 0.13199, 0.01099]     weights['TopJets'] = [109.73602, 5.99325, 0.37680, 0.03462, 0.00312]     #    multiply all by lumi     weights['TopJets'] = scale(Lumi,weights['TopJets'])     #     # NoPU     inDir['NoPU']['TopJets']  = base+'/NoPU/tjets/'     # 50PU     inDir['50PU']['TopJets']  = '/nfs/dust/cms/user/clseitz/Delphes/FILES/PhaseI_50PU_ProdAug6/tjets/'      # 140PU     inDir['140PU']['TopJets'] = '/afs/desy.de/user/t/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/PhaseII_140PU_ProdJul28/tjets/'     #inDir['140PU']['TopJets'] = base+'/tjets/'     #'/140PU/tjets/'     #---------------------------------------------STCs     # HT dirs - none for STC samples     #dirsHT['TDR4'] = ['/']     #dirsHT['TDR5'] = ['/']     #dirsHT['TDR6'] = ['/']     #dirsHT['TDR8'] = ['/']     # naturalSUSY     #dirsHT['naturalSUSY'] = ['/']     # susyhit     dirsHT['Scenario1'] = ['/']     dirsHT['Scenario4'] = ['/']     dirsHT['Scenario6'] = ['/']     dirsHT['NM1'] = ['/']     dirsHT['NM2'] = ['/']     dirsHT['NM3'] = ['/']          # xsec - we multiply by lumi   xsec*k-factor*Lumi calculated with parse.py: values for 33 TeV with 140 Pile Up     # 33TeV      #weights['TDR4'] = [68.31*1.3626*Lumi]    # values for ? 14 TeV      #12.80      #weights['TDR5'] = [19.08*1.4105*Lumi]                               # 3.82     #weights['TDR6'] = [10.87*1.4438*Lumi]                               # 2.53     #weights['TDR8'] = [ 7.777*1.4917*Lumi]                              # 2.19     # 14TeV ####### wrong ##########     #weights['TDR4'] = [9.060*1.3626*Lumi]      # values for ? 14 TeV     #12.80      #weights['TDR5'] = [4.299*1.4105*Lumi]                                # 3.82     #weights['TDR6'] = [2.039*1.4438*Lumi]                                # 2.53     #weights['TDR8'] = [1.788*1.4917*Lumi]                                # 2.19     # 14TeV     weights['TDR4'] = [12.80*Lumi]      weights['TDR5'] = [3.82*Lumi]       weights['TDR6'] = [2.53*Lumi]       weights['TDR8'] = [2.19*Lumi]     weights['naturalSUSY'] = [1.211*Lumi]     # susyhit     weights['Scenario1'] = [2.52*Lumi]     weights['Scenario4'] = [0.009635*Lumi]      weights['Scenario6'] = [2.52*Lumi]      #weights['Scenario6'] = [2.19*Lumi]      weights['NM1'] = [0.15*Lumi]      weights['NM2'] = [0.07*Lumi]      weights['NM3'] = [1.1*Lumi]      #     bit=''     if base=='nTuples/snowmass/':bit='New'      # NoPU     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr/'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr/'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr/'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr/'+bit+'/8/'     # 50PU     #inDir['50PU']['TDR4'] = base+'/50PU/tdr/'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr/'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr/'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr/'+bit+'/8/'     # 140PU     #inDir['140PU']['TDR4'] = base+'/140PU/tdr/'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr/'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr/'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr/'+bit+'/8/'     #     ############## susyhit ############################     #inDir['140PU']['Scenario1'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/STC_Third/'     inDir['140PU']['Scenario4'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/Ntuple/STOC'     inDir['140PU']['Scenario6'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/stc/READY/'     inDir['140PU']['NM1'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/1/READY/'     inDir['140PU']['NM2'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/2/READY/'     inDir['140PU']['NM3'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/3/READY/'          inDir['50PU']['NM1'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM1/'     inDir['50PU']['NM2'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM2/'     inDir['50PU']['NM3'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM3/'     inDir['50PU']['Scenario4'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/STOC/'      inDir['50PU']['Scenario6'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/STC/'     #inDir['140PU']['Scenario6'] = '/afs/desy.de/user/t/trippk/dust/snowmass/NewTupler_topness/Batch/Output/14TeV/140PU/tdr_delphes3.0.9.1_card3.0.9.1/8'     #inDir['140PU']['NM1'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM1/'     #inDir['140PU']['NM2'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM2/'     #inDir['140PU']['NM3'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM3/'     ####################################################     ################# naturalSUSY ######################     ####################################################     # 140PU     #inDir['140PU']['naturalSUSY'] = 'Output/naturalSUSY/14TeV/140PU/PhaseII_conf3/'     #inDir['140PU']['naturalSUSY'] = 'Output/naturalSUSY/14TeV/140PU/PhaseII_conf4/'     #     # NoPU 3.0.10     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     #3.0.10 - 3.0.9.1     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     #3.0.9.1      #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #     #     # 50PU 3.0.10     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     # 50PU 3.0.10 - 3.0.9.1     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     # 50PU 3.0.9.1     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #     #     # 140PU 3.0.10     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     # 140PU 3.0.10 - 3.0.9.1     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     # 140PU 3.0.9.1     #print  base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #--------------------------------------------- end of sample properties          from ROOT import TFile     from glob import glob     from sys import exit     def GetEntries(dirname):         files = glob(dirname+'/*nTuple.root')         if len(files)>1:             print 'GetEntries: there is more than 1 root file in '+dirname             exit(0)         print dirname,files         file=TFile(files[0])         tree = file.Get("delphTree")         return tree.GetEntries()          # do it     for scene in scenarios:         for samp in samples:             if do[scene][samp]:                  f=''                 print dirsHT, samp                 for i in range(len(dirsHT[samp])):                     entries = GetEntries(inDir[scene][samp]+dirsHT[samp][i])                     f=f+inDir[scene][samp]+dirsHT[samp][i]+' '+str(weights[samp][i]/entries)+' '                 print f,samp,scene                 if samp in noWeight:                     reader(f,scene+'_'+samp,False)                 else:                        reader(f,scene+'_'+samp)


Have netstat not display port numbers for foreign address

I would like to get netstat to not display port numbers on the foreign address so I can run some statistics on it. This is for a FreeBSD system. The following is a example of the output.               <root>:/# netstat -an | grep .80 |head     tcp4       0      0  61.129.65.176.80      123.120.207.172.51972   ESTABLISHED     tcp4     491      0  61.129.65.176.80      171.250.180.211.51000  ESTABLISHED     tcp4     286      0  61.129.65.176.80      123.120.207.17210399     ESTABLISHED     tcp4     299      0  61.129.65.176.80      211.8.128.46.35458    ESTABLISHED     tcp4       0      0  61.129.65.176.80      123.139.147.112.62778    ESTABLISHED     tcp4     361      0  61.129.65.176.80      239.187.139.47.17607  ESTABLISHED     tcp4     509      0  61.129.65.176.80      74.74.87.36.7822   ESTABLISHED     tcp4     324      0  61.129.65.176.80      75.30.126.198.60721     ESTABLISHED     tcp4     508      0  61.129.65.176.80      149.78.116.66.12120   ESTABLISHED     tcp4     321      0  61.129.65.176.80      48.150.75.171.2617     ESTABLISHED     <root>:/#


How to maximize the use of computer performance Core i7 960 / 12GB Ram?. My operating system is Debian 6 (Linux kernel - 3.0.0-1-amd64). I think it does not work very quickly. Looking for some ways to increase productivity, may be that the system is loaded into memory at once, then it will be faster? It may be necessary to use some features of the processor? In general, I need advice.


How to enable 'daw' vi command in zsh?

I've seen that the vi mode option in zsh is rather limited. For example, 'daw' (delete around word) and 'diw' don't work. What is the reason and how can I solve it?


How can I partition a volume in a regular file without loop?

I'm trying to play around with OS development, and I started with a boot loader, where phase 0 loads phase 1 from a file (specified by inode) on an ext4 partition (specified by first LBA). Of course, I need something to boot from, so I grabbed QEMU. Now what? What has worked fine so far is this:               truncate -s64M /tmp/SomeVolume     /sbin/mke2fs -t ext4 -F /tmp/SomeVolume     yasm phase0.asm     dd if=phase0 of=/tmp/SomeVolume conv=notrunc      I make a volume of about 64 MB, format it as ext4, and overwrite the first 1024 octets with phase0 (which is always 1024 bytes in size). This works fine. But now I want to make a properly partitioned file, to test it for more realistic scenarios. I know I could `/sbin/cfdisk` my volume file, but `mke2fs` doesn't have a parameter that lets me choose a span within the file. Now I'm aware of solutions using loop, but unfortunately, it doesn't seem to work for me (I can't seem to be able to change `max_part` in Debian jessie). There seems to be another module called `nbd`, but I don't have the server and client for that module installed. And it's getting a little ridiculous that I need root privileges for something that could clearly be done in userland. How can I do this as a user? Or should I just build the MBR/GPT-partitioned volume around the ext4-formatted file I created?


Gaussian, which is run with nohup on remote linux machine, gets killed when the local computer is powered down before the shell is exited

I have a problem running Gaussian on remote Linux via SecureCRT on Windows. ## Gaussian Gaussian spawns different child executables ("link"s) when running. For example, I start Gaussian by running `nohup g09 < test.in > test.out 2> test.out &`, and `g09` will spawns different `link`s such as `l301.exe` and `l502.exe` at specific circumstances. ## Run Gaussian When I connect to the remote Linux box, and run Gaussian using `nohup ${Path_Of_Gaussian}/g09 < jobname.in > jobname.out 2> jobname.out &`:   1. If I exit the shell by typing `exit` and press `Enter`, I can exit while Gaussian on Linux keeps running (name of the specific executable depends on specific timing).   2. If I power down the computer (then the SecureCRT will be shutdown), Gaussian on Linux gets killed and complains "hang up".   3. If I exit by typing `exit` and press `Enter`, and then log on, I can power down the computer and Gaussian on Linux keeps running.   4. `jlliagre`'s answer does not work in this case. ## Run simple command Taken a simple executable, which does nothing (i.e., deals nothing with input & output) but sleeps for 10 minutes, for example. When I run it by `nohup ${Path_Of_Executable}/executable &`:   1. If I exit the shell by typing `exit` and press `Enter`, I can exit and the executable keeps running on Linux.   2. If I power down the computer (then the SecureCRT will be shutdown), the executable running on Linux gets killed.   3. If I exit by typing `exit` and press `Enter`, and then log on, I can power down the computer (then the SecureCRT will be shutdown) and the executable on Linux keeps running.   4. As in `jlliagre`'s knowledgeable answer, if I run `nohup ${Path_Of_Executable}/executable </dev/null >/dev/null 2>&1 &`, I can power down while the executable on Linux keeps running. In other words, why would Gaussian, which is run on a remote machine with `nohup`, get killed when the local computer is powered down before the shell is exited?


How to find out which package of libc6 I need?

I am running into following error:               version GLIBC_2.14 not found      version GLIBC_2.15 not found      when trying to install software I need. Therefore, I decided to upgrade libc6 on my debian `(Linux nn15.project.org 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux)`. I found the libc6 package in this page and I guess I probably need unstable version. My questions are following:   1. How do I install specific version? So far I only used `apt-get install package`,    2. without specifying which one.which version should I use?   3. What's the difference between libc6-amd64, libc6-dbg, libc6-dev and others? I am using: Distributor ID: Debian Description: Debian GNU/Linux 7.1 (wheezy) Release: 7.1 Codename: wheezy


os-prober not detecting Arch install

I'm triple booting osx, win 7 and arch on an apple macbook pro 8,2 I've followed the guide specific for my macbook pro here: Macbook Pro 8,2 Arch Installation As well as the beginners install guide here: Arch Beginners Guide Everything has gone well and I can boot and login fine. However I've come to a problem whilst trying to configure grub2. I've run this and I've verified that its worked correctly               # modprobe dm-mod      # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug     # mkdir -p /boot/efi/EFI/grub/locale     # cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo      However when I run,               # grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg      Whilst the config generator is running it spits out text from os-prober. It lists my osx and Windows partition but nothing about Arch. The config file generated doesn't contain any information about Arch either and when I try boot into grub2, it lists 2 Mac OSX partitions, 32 and 64 bit (of which only 1 exists) and neither boot as well as a Windows 7 partition which doesn't boot either. I think a big part of the problem is that os-prober isn't detecting the installations correctly. Does anyone have any idea why this would be? Thanks, Alex


Is there a way to make feh fade in between transitions?

I would like my desktop wallpaper to fade between transitions instead of a cut. Is there a way to do this with feh? Maybe using xcompmgr or compton? If not is there a way of doing it without changing to a different wm? I am using awesome at the moment.


Why does rm *(1)* remove all files in a directory?

I expected that:               $ rm *(1)*      would remove all files containing `(1)` in the name. I was wrong. It removed all files in the directory. Why?


Home folder with Windows + Mint dual boot

I am dual-booting Linux Mint 17 Cinnamon 64-bit and Windows 8.1 64-bit. Since I use both OSes to work with the same files, I am thinking what would be the best approach to read and write files using both OSes. I am considering to create a separate partition for such files. Since Linux can access and write files located in a Windows partition but the opposite is not true, then a NTFS partition should work well for the common files. But my question is: how do I "link" the folders on this new partition to Linux /home? In Windows, there is the concept of libraries, and it is possible to add any folder in your system to the useful "My Music", "My Videos", etc. in "My documents". Would it be possible to do something similar with Linux? Or do I really have to mount this partition every time I boot my system and manually navigate to its subfolders? Or yet, is there any better approach to deal with common files than what I am proposing?


Installing CoGrOO on Kile

Does anyone know if it is possible to install/include CoGrOO on Kile? CoGroo: http://cogroo.sourceforge.net/


How to tell if mysterious programs in nethogs listing are malware?

This is what I see in Nethogs: ![Screenshot](http://i.stack.imgur.com/2or3H.png) I'm concerned about the listings with PID `?`, running as `root`. How can I find out what these are? I'm running Linux Mint 14. Please let me know what other information I should include.


execute bash script inside .bashrc

Hi I am curious if it is possible to execute a bash script inside bash rc. It would seem to create a infinite loop unless there was some way to tell it to not try and start a new shell. Here is an example bash_script.sh:               #!/bin/bash     echo Hello World      .bashrc               export HELLO_WORLD=$(bash_script.sh)


Increment xml files with bash

A good mate on a forum had helped me with creating this script but everything Ive thrown at it outputs wrong and I do not know why or what is the issue. I ran all my script in ubuntu's terminal if questioned as bash test.sh. My goal is to increment several .xml file's `process></process>` tags, but some files could have 1 to 100 tags. **Example:**                - jfksaJDFH      - <process>value=""</process>      - <process>value=""</process>      - <process>value=""</process>      - <process>value=""</process>      - jdhkjasdh      - <process>value=""</process>      - <process>value=""</process>      - <process>value=""</process>      - <process>value=""</process>      **After script:**                - jfksaJDFH      - <process>value="1"</process>      - <process>value="2"</process>      - <process>value="3"</process>      - <process>value="4"</process>      - jdhkjasdh      - <process>value="5"</process>      - <process>value="6"</process>      - <process>value="7"</process>      - <process>value="8"</process>      **Script:**               #!/bin/bash          dir="/mnt/Desktop/test/"          while IFS= read -r -d '' file     do         i=1         while IFS= read -r -u 3 line         do             if [[ $line = '<process></process>' ]]; then                echo "<process>value=\"$((i++))\"</process>"             else                echo "$line"             fi         done 3< "$file" > "$file.xml"     done < <(find $dir -type f -name \*.xml -print0)      when script above is ran removes last `<process>value=""</process>` **modify script to this:**               while IFS= read -r -d '' file     do         i=1         while IFS= read -r -u 3 line         do             if [[ $line = '<process></process>' ]]; then                echo "$line"             else                echo "<process>value=\"$((i++))\"</process>"             fi         done 3< "$file" > "$file.xml"     done < <(find $dir -type f -name \*.xml -print0)      **Output of file is this:**               <process>value="1"</process>     <process>value="2"</process>     <process>value="3"</process>     <process>value="4"</process>     <process>value="5"</process>     <process>value="6"</process>     <process>value="7"</process>     <process>value="8"</process>     <process>value="9"</process>     <process>value="10"</process>     <process>value="11"</process>     <process>value="12"</process>     <process>value="13"</process>     <process>value="14"</process>     <process>value="15"</process>     <process>value="16"</process>     <process>value="17"</process>     <process>value="18"</process>     <process>value="19"</process>     <process>value="20"</process>     <process>value="21"</process>     <process>value="22"</process>     <process>value="23"</process>      which in other words increments but removes all other content in the page.


Regex for phrase matching with case statement in ksh

I am trying to start or stop a service on AIX in ksh. I am trying to start to build in fool proofing for checking things like if the services is already down, etc. Here is my script               #!/bin/ksh               #################################################################################     #                        PARAMETERS & VARIABLES SECTION                         #     #################################################################################          DBI_LOC="DBI/InstallCollector/dbi_collector/bin"          #Put input option to upper case.     OPTION=$( echo "$1" | tr "[:lower:]" "[:upper:]" )          #################################################################################     #                              FUNCTION SECTION                                 #     #################################################################################          parseresults() {         typeset RESULT="$1"              if [ "${OPTION}" = "START" ] ; then             case "${RESULT}" in                  *)                     echo "Success"                 ;;             esac         else             case "${RESULT}" in                  DBI.(Collector is not running))                     echo "Collector is already down. Continuing..."                 ;;                 DBI.(performance data collector shutdown COMPLETE))                     echo "Success shutting down collector. Continuing..."                 ;;                 *)                     echo "Error shutting down the collector. Exiting with error."                     exit 1                 ;;             esac         fi     }               #################################################################################     #                             MAIN SCRIPT SECTION                               #     #################################################################################                    case "${OPTION}" in         "START")             echo "Starting the collectors..."             RESULT=$(ksh ~/${DBI_LOC}/start_dbi_collector.sh)             ;;         "STOP")             echo "Stopping the collectors..."             RESULT=$(ksh ~/${DBI_LOC}/stop_dbi_collector.sh)             ;;         *)             echo "Error: No Parameter specified. Must be either start or stop"             exit 1             ;;     esac          echo ${RESULT}     parseresults ${RESULT}          echo     echo      I can't seem to get it to match on the two DBI phrases. Both of those are possible outputs from their stop script. I want to consider those successes, but anything else a possible failure. I'm still learning regex (and its differences in Java vs ksh, etc.) so you'll have to excuse my rustiness. What am doing wrong? And in your answer could you please explain why mine doesn't work and the right answer does. (I'm a proponent of the whole if you teach someone to fish thing....) **EDIT:** I'm thinking it has something to so with the parenthesis. I have another script which had the same problem of hanging, but when I removed the parens, the function quite hanging. So my trick is still how to do matching on phrases....


Generic HTTP server that just dumps POST requests?

I am looking for a command line tool that listens on a given part, happily excepts every HTTP POST request and dumps it. I want to use it for testing purposes, i.e. for testing clients that issue HTTP POST requests. That means I am searching the counterpart to `curl -F` (which I can use to send test HTTP POSTs to a HTTP server). Perhaps something like `socat TCP4-LISTEN:80,fork,bind=127.0.0.1 ...` - but socat is not enough because it does not talk HTTP.


How to enable force feedback in kernel 2.6.34 - 64 bit?

The wheel is `Logitech driving force DFGT`. The platform:               linux-dopx:/home/anisha/ # cat /etc/issue && uname -a      Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).     Linux linux-dopx 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux      To check the force feedback I did:               linux-dopx:/home/anisha/ # fftest /dev/input/event4     Force feedback test program.     HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES          Device /dev/input/event4 opened     Axes query:     Effects:     Number of simultaneous effects: 0     Upload effects[0]: Function not implemented     Upload effects[1]: Function not implemented     Upload effects[2]: Function not implemented     Upload effects[3]: Function not implemented     Upload effects[4]: Function not implemented     Upload effects[5]: Function not implemented     Enter effect number, -1 to exit      fftest failed with `Function not implemented` message.   The wheel is being detected through event4 and js0 files in /dev/input/               # cat /proc/bus/input/devices     shows:     I: Bus=0003 Vendor=046d Product=c29a Version=0111     N: Name="Driving Force GT"     P: Phys=usb-0000:00:1d.3-1/input0     S: Sysfs=/devices/pci0000:00/0000:00:1d.3/usb5/5-1/5-1:1.0/input/input7     U: Uniq=     H: Handlers=event4 js0     B: EV=1b     B: KEY=1f0000 0 0 0 0 0 0 ffff00000000 0 0 0 0     B: ABS=30007     B: MSC=10      How to counter this? No, I am not running any game. I just wanted to apply these effects to my wheel. I even tried `modprobe hid-logitech` and `modprobe hid`, they didn't help. Please help.


How to edit files in-place while performing operation on the values matching the searched pattern?

Given a list files containing random text and many datetimes in ISO format in it (e.g "2012-07-02T10:47:24+02:00"), how can I find all these datetimes and add 2 hours to each one ? Ideally a solution that takes into account the fact that a day is 24 hours would be great (i.e "02T23:15 + 2" should result in "03T01:15" and not "02T25:15") but in my case that's not a big deal. And let's ignore the possible timezone consequences, and consider this as a simple math operation. I already know how to do this in Python for instance, reading all files line by line and replacing the line when datetimes are found but I wonder if there is a more straightforward way of doing this, with awk or sed maybe ? Thanks!


Non-graphical tty's not stretching full screensize

on tty7 (graphical environment) nothing's wrong, I can enjoy the whole pixels of my screen which is the main thing. But here's something a bit annoying, when I switch on terminals from 1 to 6, the visual space is shrunk to get into the upper left corner of my screen leaving the rest unused. worth a million words : ![pretty boring](http://i.stack.imgur.com/55HZb.png) _How can I fix that ?_ **update :** here's an shot of my screen ![enter image description here](http://i.stack.imgur.com/lydiN.jpg)


how implement patch for change a arbitrary Governor in linux

> **Possible Duplicate:**   >  Implementing patch for changing a CPU frequency governor I am beginner in linux.I want implement a patch for change a arbitrary Governor in linux.not important what Governor be it.I only want some example for this work.thanks


Losing wifi connection to access point after a few minutes (hostapd, dnsmasq, iptables)

I'm using a laptop as a wifi access point. Since this laptop has the proper hardware, I was able to use `hostapd`. I wanted to use DHCP and `iptables`/NAT forwarding instead of a bridge to have more control over the connection. I made a script to execute all commands. My devices are able to connect to the access point and have full access to the internet for the first few minutes. After this amount of time, no devices are able to connect to the access point anymore. The only way to re-establish a connection is if I reboot the laptop and relaunch the script. Here is my script:               #!/bin/bash     echo 1 > /proc/sys/net/ipv4/ip_forward          # Clear iptables Rules     iptables -F     iptables -t nat -F          # iptables Rules     iptables -A FORWARD -d 192.168.1.0/24 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT     iptables -A FORWARD -s 192.168.1.0/24 -i wlan0 -j ACCEPT     iptables -t nat -A POSTROUTING -o p4p1 -j MASQUERADE          # Set wlan0 IP     ip addr add 192.168.1.1/24 broadcast 192.168.1.255 dev wlan0     ip link set wlan0 up          # Set DHCP     dnsmasq -C /dev/null >/dev/null 2>&1 --listen-address=192.168.1.1 --dhcp-range=192.168.1.2,192.168.1.200,12h          # hostapd     hostapd /etc/hostapd/hostapd.conf      Where `hostapd.conf` has the following content:               ctrl_interface=/var/run/hostapd     ctrl_interface_group=wheel     macaddr_acl=0     auth_algs=1     ignore_broadcast_ssid=0     wpa=3     wpa_key_mgmt=WPA-PSK     wpa_pairwise=TKIP     rsn_pairwise=CCMP     wpa_passphrase=testomesto     driver=nl80211     interface=wlan0     hw_mode=g     channel=1     ssid=osumi-0      Additional information:   * Network hardware: Broadcom Corporation BCM4311 802.11a/b/g (rev 01)   * Network subsystem: Dell Wireless 1490 Dual Band WLAN Mini-Card   * Network driver: b43-pci-bridge   * OS: Fedora 17 (up to date) Below is an image of an iPod showing correct IP and router information ![enter image description here](http://i.stack.imgur.com/rgSFG.png)


What program displays volume/screen brightness under KDE?

It seems there's some bug in KDE related to power management and after putting my netbook to sleep several times, plugging it in and out, the notification about screen brightness set to 100% doesn't want to vanish (and as I modify brightness through keys, another one spawns right on top of the previous one, both half-transparent, two sets of numbers). Now, I could just kill the superfluous process if I ever knew how it's named. The notification, being an overlay, is "transparent" to 'xwininfo' and the likes. There's a tad too many processes I don't know to start killing by trial and error. Sure restarting X would help but I'd like to get by without reopening my sessions in everything I have open. Once I know what to kill/restart I should be able to solve it (and if I can't restart it, so be it, better no brightness indicator than one stuck!) So, what's the name of the process that displays this: ? ![enter image description here](http://i.stack.imgur.com/lns2U.png)


Use grep to find all files in a directory with two strings

I am trying to figure out the correct syntax to find two strings, the entire part of each string, anywhere (doesn't have to be near each other) in a file. So any file that has both `foo` and say the number `321`, doesn't have to be alone and can be a substring should match. I've tried the following without much luck:               grep 'foo\|321' *          grep 'foo|321'


Puppet, managing two depending file resources?

I cannot figure out, how to deal with case when I have 2 resources managed by puppet, depending on each other (one is parent of another), and both are set to be `absent`. Test case below. Directories doesn't exists already, but puppet complains about creating files there. How to fix this manifest?               $ find . -type f     ./modules/test/manifests/init.pp     ./modules/test/files/b/x     ./modules/test/files/b/z     ./modules/test/files/b/y     ./manifests/site.pp     ./test.pp     $ cat manifests/site.pp      ## site.pp          node default {         include test     }     $ cat modules/test/manifests/init.pp      ## init.pp          class test {         file { 'dir1':             ensure  => absent,             path    => '/tmp/a',             before  => File['dir2'],         }              file { 'dir2':             ensure  => absent,             path    => '/tmp/a/b',             source  => 'puppet:///modules/test/b',             force   => true,             purge   => true,             recurse => true,              }     }     $ puppet apply --modulepath ./modules manifests/site.pp     Notice: Compiled catalog for localhost in environment production in 0.11 seconds     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: /Stage[main]/Test/File[/tmp/a/b/z]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: /Stage[main]/Test/File[/tmp/a/b/y]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Error: /Stage[main]/Test/File[/tmp/a/b/x]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Notice: Finished catalog run in 0.14 seconds      EDIT: Full context:               ## init.pp          class test {              $is_master  = false              if $is_master {             $file_ensure        = present             $directory_ensure   = directory         } else {             $file_ensure        = absent             $directory_ensure   = absent         }              file { 'dir1':             ensure  => $directory_ensure,             path    => '/tmp/a',             before  => File['dir2'],         }              file { 'dir2':             ensure  => $directory_ensure,             path    => '/tmp/a/b',             source  => 'puppet:///modules/test/b',             force   => true,             purge   => true,             recurse => true,         }     }      You cannot remove dir1, because it'll fail on master, I need to make it works on master and slave.


File attributes does not exist in Linux?

There is no equivalent of Window's file attributes for Linux ?


How to copy the home directory in the home directory?

I need to make a copy of my home directory and place that copy in the same home directory. The exit code of the command must be `0`. Currently, my home directory does not contain any other directories. Is there a better way than the following? (pwd is the home directory)               mkdir /tmp/temp && cp * /tmp/temp && mv /tmp/temp .


error using yum in centos 6

my yum command used to work fine , but now , when I try to use it , it gives me an error :               file:///home/user/repo/repodata/repomd.xml: [Errno 14]      Could not open/read file:///home/user/repo/repodata/repomd.xml      I don't know what to do , please help me.


Gnome 3 notification not working after switching back from XFCE 4

I'm using Archlinux. I've recently switched back from XFCE 4 to Gnome 3. So i reinstalled `notification-daemon` (since there was a conflict between it and XFCE 4 notification daemon)               pacman -S notification-daemon      .. and removed `xfce4-notifyd`               pacman -R xfce4-notifyd      But now, notification in Gnome 3 is not working at all. I don't know what else should i do. Thanks.


How do I mount an NTFS partition in /etc/fstab and prevent files/directories from receiving exec permissions when they're created?

I have an NTFS partition that I want to mount using `/etc/fstab`. I don't want any files to have executable permissions on this drive, so I wrote the following rule:               /dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async 0 0      However, I don't believe this will prevent files from being created with executable permissions. It will simply prevent them from being executed. Perhaps this is fine, but is it possible to remove all executable permissions from newly created files on this partition using an `/etc/fstab` rule? Would using `umask` and `fmask` be enough, like this rule?               /dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async,umask=0111, 0 0      I'm unsure because Wikipedia lists `umask` as an option specific to the FAT filesystem.


Declare a new modifier key with XKB

I'm trying to create a one handed keyboard layout and want to use `Hyper` to produce special keys when I press some keys. For example, when I press `Hyper_L` and `B`, I want XKB to produce `XF86AudioRaiseVolume`. Relevant parts from `custom_2.kbd` (full code at http://pastebin.com/gm8cggn3) :               xkb_keycodes {         <K_36> = 54;        // b B XF86AudioRaiseVolume         <K_85> = 133;       // Hyper_L     };          xkb_symbols {         key <K_36> { type = "HYPER_LEVEL", [ b, B, XF86AudioRaiseVolume ] };         key <K_85> { type = "ONE_LEVEL", [ Hyper_L ] };     };          xkb_compatibility {         interpret Hyper_L { action = SetMods(modifiers=Hyper); };     };               xkb_types {     type "HYPER_LEVEL" {         modifiers= Shift+Hyper;         map[Shift]= Level2;         map[Hyper]= Level3;         map[Shift+Hyper]= Level3;     };     };      It seems fine to me, but when I try it:               ~$ xkbcomp custom_2.kbd $DISPLAY     Error:            Identifier "Hyper" of type int is unknown     Error:            Key type mask field must be a modifier mask                       Key type definition ignored     Warning:          Map entry for unused modifiers in HYPER_LEVEL                       Using none instead of Shift     Error:            Identifier "Hyper" of type int is unknown     Error:            The key type map entry field must be a modifier mask                       Ignoring illegal assignment in HYPER_LEVEL     Error:            Identifier "Hyper" of type int is unknown     Error:            The key type map entry field must be a modifier mask                       Ignoring illegal assignment in HYPER_LEVEL      -> 1      (error code is 1) And now I'm stuck. Does anyone have an idea how to make this work? A solution without `Hyper` is OK. # Edit By changing `Super` and `Hyper` to `Mod4` and `Mod5`, that error goes away:               ~$ xkbcomp custom_3.kbd     ( no output )          ~$ diff custom_{2,3}.kbd     188,190c188,190     <         interpret Super_L { action = SetMods(modifiers=Super); };     <         interpret Hyper_L { action = SetMods(modifiers=Hyper); };     <     }c;     ---     >         interpret Super_L { action = SetMods(modifiers=Mod4); };     >         interpret Hyper_L { action = SetMods(modifiers=Mod5); };     >     };     204c204     <             modifiers= Shift+Hyper;     ---     >             modifiers= Shift+Mod5;     206,207c206,207     <             map[Hyper]= Level3;     <             map[Shift+Hyper]= Level3;     ---     >             map[Mod5]= Level3;     >             map[Shift+Mod5]= Level3;      However, it still doesn't work:               ~$ xkbcomp custom_3.kbd $DISPLAY      Error:            success in unknown                       Couldn't write keyboard description to :0.0     X Error of failed request:  BadValue (integer parameter out of range for operation)       Major opcode of failed request:  135 (XKEYBOARD)       Minor opcode of failed request:  9 (XkbSetMap)       Value in failed request:  0x8010202       Serial number of failed request:  12       Current serial number in output stream:  14      -> 1


Copy file from Windows shared folder to Unix

I am totally new to Unix. I am writting a script which will copy files from a Windows shared folder to Unix. In Windows, when I type `\\\Servername.com\testfolder` in Run command I am able to see `testfolder`. The directory `testfolder` is a shared folder through the whole network. Now I want to copy some files from that `testfolder` to a Unix machine. Which command should I use? I know the IP Address of server but I don't know the username.


What is the connection between jiffies and IPS? How to convert jiffies to IPS?

Reading from `/proc/PID/stat` a lot of information can be processed. I would like to see how many percentages has been used of CPU power by this process. There are a lot of variable around here (utime, stime, cutime, cstime, gtime, cgtime) but they are in jiffies. The problem with this that jiffy depends on speed of the current CPU. However IPS (Instructions Per Second) depends on inctructions set, and which program do we run but maybe this is more accurete. I would like to use this information in embedded systems where I could pick a CPU that just satisfies the features. In this way I don't have to spend a lot for a largly oversized system. Here is the contents of the stat file (as of 2.6.30-rc7):                Field          Content       pid           process id       tcomm         filename of the executable       state         state (R is running, S is sleeping, D is sleeping in an                     uninterruptible wait, Z is zombie, T is traced or stopped)       ppid          process id of the parent process       pgrp          pgrp of the process       sid           session id       tty_nr        tty the process uses       tty_pgrp      pgrp of the tty       flags         task flags       min_flt       number of minor faults       cmin_flt      number of minor faults with child's       maj_flt       number of major faults       cmaj_flt      number of major faults with child's       utime         user mode jiffies       stime         kernel mode jiffies       cutime        user mode jiffies with child's       cstime        kernel mode jiffies with child's       priority      priority level       nice          nice level       num_threads   number of threads       it_real_value (obsolete, always 0)       start_time    time the process started after system boot       vsize         virtual memory size       rss           resident set memory size       rsslim        current limit in bytes on the rss       start_code    address above which program text can run       end_code      address below which program text can run       start_stack   address of the start of the stack       esp           current value of ESP       eip           current value of EIP       pending       bitmap of pending signals       blocked       bitmap of blocked signals       sigign        bitmap of ignored signals       sigcatch      bitmap of catched signals       wchan         address where process went to sleep       0             (place holder)       0             (place holder)       exit_signal   signal to send to parent thread on exit       task_cpu      which CPU the task is scheduled on       rt_priority   realtime priority       policy        scheduling policy (man sched_setscheduler)       blkio_ticks   time spent waiting for block IO       gtime         guest time of the task in jiffies       cgtime        guest time of the task children in jiffies


Why does this variable have no value even though it is set in .bashrc?

If I append this:               hi=11     export hi      to the .bashrc and then I su to this user with:               su - bela      then I:               echo $hi     11      Then it's working, the "hi" variable has the value of "11". But. When I:               su -c "echo $hi" bela      the variable "hi" has no value. Why? (running on CentOS 6)


How to backup and restore Oracle 10G Express in Linux VPS?

I have installed Oracle 10g Express in two Centos VPS server. How can I generate an Oracle backup from server one, so that I can restore the database on server two? Can anyone help on this?


Showing all open apps in all workspaces on the desktop panel for Linux Mint

I'm using Linux Mint 14 with XFCE. The bottom panel that always shows below the screen which shows an icon for each instance of application that is open is a very handy item as it allows one to switch from one app to another very quickly. The problem is that, with more than one workspace being used, one can see on the panel only the applications that are open in that one workspace they are in at the moment but not the open apps in the other workspace. So the problem I am finding is this: If I am in one workspace, and want to switch to an app that I know I opened before, I have to change workspaces one by one, looking at the panel in each to find that app. This is time consuming. It would be much better if the panel displays all open apps in all workspaces. One can configure the panel to have more than one row and to make the icon sizes small. So it is not a problem to have many icons there if needed. I looked at preferences for panel, but it does not have such an option. ![enter image description here](http://i.stack.imgur.com/cpA1y.png) Is it possible to configure this on Mint 14 with XFCE? If not, which other distribution do you recommend that would support this? I know Mint has other types of distros with different desktop managers.


Where can PATH to Thunderbird be set in Ubuntu 10.04

I'd like to migrate to `Thunderbird 11` from `Thunderbird 3`. I installed `Thunderbird 3` using apt-get (the newer versions are not available in binary form, unfortunately, at least not in main, universe or multiverse repositories, don't like PPA's when not really necessary). So I downloaded tar.bz2 of the newest version and uncompressed into /usr/lib, next to where the old version lives. Now, I'd like the system to find `thunderbird` inside `Thunderbird 11` folder rather than the old one. How to I achieve that? I know there must be some sort of a `PATH` to `/usr/lib/thunderbird-3.1.20` set on my system, but just cannot find where it is. Checked all common places already, like:   * `/etc/environment`   * `/etc/profile`   * `/etc/profile.d/*`   * `~/.profile`   * `~/.bashrc` (though it shouldn't be here as `PATH` is also visible by GNOME)   * probably some other places I don't recall now. Any clues?


linux-sunxi - make failed, undefined references clk_*

I try to build uImage for linux-sunxi on a Debian box, which is prepared like this (How To Build Debian From Source Code for Mele):               apt-get install emdebian-archive-keyring     apt-get install gcc-4.4-arm-linux-gnueabi     apt-get build-essential git     apt-get uboot-mkimage     apt-get libusb-1.0-0-dev      I am following the guide at FirstSteps and have done all instructions without errors. `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- defconfig` works, but `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j5 uImage` fails:                 LD      .tmp_vmlinux1     arch/arm/common/built-in.o: In function `sp804_get_clock_rate':     timer-sp.c:(.init.text+0x31c): undefined reference to `clk_get_sys'     timer-sp.c:(.init.text+0x364): undefined reference to `clk_put'     timer-sp.c:(.init.text+0x398): undefined reference to `clk_put'     arch/arm/mach-versatile/built-in.o: In function `versatile_init_early':     versatile_ab.c:(.init.text+0x134): undefined reference to `clkdev_add_table'     drivers/built-in.o: In function `clcdfb_remove':     hid-input.c:(.text+0xd790): undefined reference to `clk_put'     drivers/built-in.o: In function `clcdfb_probe':     hid-input.c:(.text+0xdc70): undefined reference to `clk_get'     hid-input.c:(.text+0xde04): undefined reference to `clk_put'     drivers/built-in.o: In function `amba_get_enable_pclk':     hid-input.c:(.text+0xe448): undefined reference to `clk_get'     hid-input.c:(.text+0xe470): undefined reference to `clk_put'     drivers/built-in.o: In function `amba_put_disable_pclk':     hid-input.c:(.text+0xe49c): undefined reference to `clk_put'     drivers/built-in.o: In function `pl011_remove':     hid-input.c:(.text+0x2b6c4): undefined reference to `clk_put'     drivers/built-in.o: In function `pl011_probe':     hid-input.c:(.text+0x2c234): undefined reference to `clk_get'     hid-input.c:(.text+0x2c318): undefined reference to `clk_put'     drivers/built-in.o: In function `enable_clock':     hid-input.c:(.text+0x3a004): undefined reference to `clk_get'     hid-input.c:(.text+0x3a01c): undefined reference to `clk_put'     drivers/built-in.o: In function `disable_clock':     hid-input.c:(.text+0x3a044): undefined reference to `clk_get'     hid-input.c:(.text+0x3a05c): undefined reference to `clk_put'     drivers/built-in.o: In function `__pm_clk_remove':     hid-input.c:(.text+0x3a1b8): undefined reference to `clk_put'     drivers/built-in.o: In function `pm_clk_add':     hid-input.c:(.text+0x3a424): undefined reference to `clk_get'     drivers/built-in.o: In function `mmc_io_rw_extended':     hid-input.c:(.text+0x6d9ac): undefined reference to `sunximmc_check_r1_ready'     drivers/built-in.o: In function `amba_kmi_probe':     hid-input.c:(.devinit.text+0x8bc): undefined reference to `clk_get'     drivers/built-in.o: In function `amba_kmi_remove':     hid-input.c:(.devexit.text+0xd4): undefined reference to `clk_put'     make: *** [.tmp_vmlinux1] Fel 1      Here is a complete dump: http://pastie.org/5351582 I have tried google the errors codes, but I cannot find anything about the several references to `clk_*`, what are these functions and how do I install them on Debian?


What characters do I need to escape when using sed in a sh script?

Take the following script:               #!/bin/sh     sed 's/(127\.0\.1\.1)\s/\1/' [some file]      If I try to run this in `sh` (`dash` here), it'll fail because of the parentheses, which need to be escaped. But I _don't_ need to escape the backslashes themselves (between the octets, or in the `\s` or `\1`). What's the rule here? What about when I need to use `{...}` or `[...]`? Is there a list of what I do and don't need to escape?


How to have a chroot system mount shared with its host?

Say I `chroot`ed into `~/myroot` with its `/mnt` being bind-mounted from the host's `/mnt`. Now (from _within_ the `chroot` environment) I want to e.g. `mount /dev/something /mnt/something` such that not only the host's `~/myroot/mnt/something` but also _its_ `/mnt/something` contains this mount. How can this be achieved? Unfortunately, the `mount` command of `busybox` doesn't seem to implement `\--make-shared` mentioned here, which should make `mount --make-shared --bind /mnt ~/myroot/mnt` run on the host make this work (untested though!), so how can this be achieved with `busybox`?


dpkg --configure -a not working

![enter image description here](http://i.stack.imgur.com/OlJF7.png) This command has been running for 1 hour and it is still not repaired. I use Debian 7.


On Gentoo, what is loading up my network interfaces?

I have 2 networking interfaces `eth0` (wired) and `wlan0` (wireless). Every time the computer boots it tries to bring up both. Most often when there is a LAN cable I don't need `wlan0`, and vice versa, so this looks like a waste. I want to stop the interfaces from being brought up automatically so that I can bring up the one that I need, if at all. According to the Gentoo Handbook I need to run               # rc-update add net.eth0 default      to have `eth0` up every time the system boots and I assume the same thing goes for `wlan0`. However the result of               # rc-update show      does not contain either `eth0` or `wlan0`. So the question is, who is bringing up the 2 interfaces? How can I stop that?


How can I chase a program who is rising up my laptop's temperature?

After 40 days of non-upgrading I came back from a trip and I decided to dist- upgrade my Debian Sid box. Everything went fine but after rebooting I noticed that the temperature was 15°C over its average. There isn't any process eating more CPU than normal but something is clearly going on. Seeing my system monitor applet for Processor load, when the machine is idle, I can see little blue peaks from time to time which I don't remember having them, maybe that could be a clue. Anyway, I cannot see anything strange in my top command output. So, how can I trace the origin of this heater process?


Error when tryhing to rebuild an RPM

I just use Linux for a LAMP server. I'm currently installing Apache 2.4 on CentOS 6.4 (x64). How do I resolve this error below?               rpmbuild: arguments to --root (-r) must begin with a /     [root@microtrack src]# rpmbuild --rebuild /distcache-1.4.5-23.src.rpm     error: cannot open /distcache-1.4.5-23.src.rpm: No such file or directory


iptrace for linux: how can I trace full packet contents?

I normally use `iptrace` on our AIX servers to get packet traces but have recently found out that this doesn't work for other 'nix systems - namely Centos. Does anyone know what the analog would be? I've tried the following, but none seem to work as I expect:               697  sudo /usr/sbin/tcpdump -w test.pcap -i eth0     1010  sudo /usr/sbin/tcpdump port 80     1012  sudo /usr/sbin/tcpdump port 80 -i eth0     1015  sudo /usr/sbin/tcpdump -A port 80 -i eth0     1017  sudo /usr/sbin/tcpdump -w ~/capture.pcap port 80 -i eth0      I can see the header data in wireshark, but I can't seem to see the _actual_ packet data.


Provide user name when using vim with scp

I was reading about SSH here http://blogs.perl.org/users/smylers/2011/08/ssh- productivity-tips.html and found that you can use `vim` to directly modify a file on a remote server that you can `ssh` into. Like:               vim scp://testserver/path/filename      And it works perfectly except that I need to provide a **username** (because I have a different user name on the server). How can I do that? (vim asks for the password, but uses my local username)


List files in a directory with a certain extension

I created a file called `~/usrlibs.txt`, which contains the number of files that begin with `lib` and end `.a` found in the `/usr/lib directory`. I tried:               ls -l /usr/lib/lib .a | wc -w > ~/usrlibs.txt       But this command is not working correctly. What am I missing?


How can I prevent my wifi driver from going catatonic?

I'm using a Lenovo T430s with an `Intel(R) Centrino(R) Ultimate-N 6300` wireless chipset. On certain wireless networks, I experience frequent wifi lockups, which require me to reload the wireless module thusly:               modprobe -r iwlwifi     modprobe iwlwifi      The main clue, aside from lost connectivity, that I need to do this is that dmesg shows:               [ 9351.591170] iwlwifi 0000:03:00.0: Queue 11 stuck for 2000 ms.     [ 9351.591178] iwlwifi 0000:03:00.0: Current read_ptr 153 write_ptr 161     [ 9351.591182] iwlwifi 0000:03:00.0: On demand firmware reload     [ 9351.592001] ieee80211 phy0: Hardware restart was requested     [ 9351.592149] iwlwifi 0000:03:00.0: L1 Enabled; Disabling L0S     [ 9351.599072] iwlwifi 0000:03:00.0: Radio type=0x0-0x3-0x1        1. What causes this?   2. Is there any way to prevent this? I'm using Linux kernel 3.2.0-4-amd64 from Debian wheezy.


how to delete temp and log files with terminal on vps?

I'm kinda pretty new to this but anyone know how to delete any temp and log files or these kind of files on vps with terminal? I'm runnin debian on the vps. I'm troubled since I can't locate those files.


DBUS interface to decrypt a LUKS device?

In modern DEs, like KDE or XFCE, you can mount a LUKS device after entering the password. Now I want to do this without the file manager, with two steps,   1. Decrypt the device   2. Mount the disk with `udisks` command For the first step, there should be a dbus interface involved, any ideas? Or correct me on how the file managers do that without root permission ... (P.S I'm not asking for a `sudo` solution, although I could do that, but I prefer a dbus solution)


How to control the permission of an application

I don't want the application have the permission to read some files that is my personal information, can I do it by setting the permission? I hear that AppArmor, is it easy to use? How to get it in openSUSE 12.3


How do I change the way of switching the workspaces in Cinamon 16?

I'm on Linux Mint 16 Cinnamon. It's pretty annoying for me that the switcher for the workspaces is on left top corner and whenever I get the mouse cursor there **by mistake** , the workspace switcher activates. I don't like it. I want to have a switcher like in Mate - on the panel next to watch. But I don't want to install Mate only for that reason. And I want to disable the default switcher (it's called Expo mode if I recall correctly). Your thoughts?


Emerge ParseError with any parameters

I tried to install a program via emerge, it only gives me this               ParseError: Invalid token '${.CURDIR}' (not '='): /etc/make.conf: line 22 in /etc/make.conf      I understand there must be a mistake in the `make.conf`... So my question probably is: What's the regular `make.conf` file for installing programs?


How to build and publish binaries for multiple Debian/Ubuntu distributions?

For a proprietary piece of software I'd like to build and publish multiple versions of software for multiple distributions. E.g. 1.0, 1.1 and both versions for squeeze, wheezy and precise. The builds are run on automatically on different machines and produce distribution-specific `.deb` files. Distribution-specific in a way that they're linked to distribution-specific versions of libraries. E.g. OpenSSL 0.9.8 for squeeze, 1.0.1 for wheezy. However, these packages are built using the same version number and package name. This is what is probably the cause for the issue following. Currently I'm using reprepro with the `includedeb` command to add the binaries to the repository. This works out fine, until I add the same package version built for a second distribution. Publishing for Squeeze is fine               # reprepro -b ./repo --outdir ./wwwpub/repo includedeb squeeze /path/to/sqeezepackages/packagename-1.0.deb      But then publishing the same version of the software built on wheezy, publishing for wheezy fails:               # reprepro -b ./repo --outdir ./wwwpub/repo includedeb wheezy /path/to/wheezypackages/packagename-1.0.deb      /path/to/wheezypackages/packagename-1.0.deb: component guessed as 'main'     ERROR: '/path/to/wheezypackages/packagename-1.0.deb' cannot be included as 'pool/main/p/packagename/packagename_1.0_all.deb'.     Already existing files can only be included again, if they are the same, but:     md5 expected: e7df7cd2ca07f4f1ab415d457a6e1c13, got: 0fa924209085a5713f79e6a30649455f     sha1 expected: 947b41827bbac414baddf0648b9abecaad8de4fe, got: 1be168ff837f043bde17c0314341c84271047b31     sha256 expected: a883dafc480d466ee04e0d6da986bd78eb1fdd2178d04693723da3a8f95d42f4, got: a93dbf1e95ddc4cfa84e9cd3cfa6c9e0e14affd79812abde4bca688224430a65     size expected: 1234, got: 1235     There have been errors!      I assume my build needs a unique version number for each distribution.   * What's the easiest way to accomplish this?   * How do I add this to the current version number? Is it advised to use something like `1.1~wheezy`, `1.1+wheezy`, `1.1-1` (incrementing), `1.1+deb6`, etc.? As `jessie` is coming up and I'd like the system to recognize this during dist-upgrades, I think just using the distribution name won't work as `j` comes before the `w` and will be recognized as older by APT.   * Once determined how to build up the version number; how do I add this to my tooling? I guess I need heuristics in the `debian/control` files to have the version number specific to the distribution it's built on. And for the changelog I'll have to invoke `dch` to comply with that version number as well.


Arch Linux , mount disks with thunar , without password

I just setup a minimal installation of Arch , installed gvfs , thunar-volman. But mounting disk requires password , this shouldn't happen. How should I work it out ?


How to install OpenSuse 11.4 through an ISO without burning it to a DVD?

How to install **OpenSuse 11.4** through an **ISO** without burning it to a DVD? Installation needs to be done on hardware, not on some virtual machine.               anisha@linux-dopx:~/tarBalls> uname -a && cat /etc/issue     Linux linux-dopx 3.2.1-12-desktop #1 SMP PREEMPT Thu Jan 19 16:02:50 IST 2012 x86_64 x86_64 x86_64 GNU/Linux     Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).


How to migrate between two keyrings in gnome-keyring

Due to some historic reasons I have 2 keyrings. I want to merge them - what is the easiest way?


How can I convert a pdf file from gray-scale to black-white?

My OS is Ubuntu 12.04. How can I convert a pdf file from gray-scale to black- white? The gray-scale pdf file comes from scanning with gray-scale option, and the black-white scale pdf is required by OCR. * * * Update: Following Marco's reply, the B-W pdf isn't good and the original file is here.


What's the best distro/shell-agnostic way to set environment variables?

The question says it all. I currently use Arch Linux and the zsh, but I'd like a solution that (at minimum) works both on VTs and in xterms and also (hopefully, preferably) will continue to work if I switch distros or shells. I've heard wildly disparate answers to this question in different distros' docs. Ubuntu says "use .pam_environment". I think in Arch what they recommend depends on your shell. Currently I put everything in .profile and if a shell doesn't source that for some reason (e.g. bash if .bash_profile exists), I override that by manually sourcing it. But it seems like there must be a better way.


find and exec: why does this command not work?

I don't get why echo prints empty line (latest cygwin version):               ~/tmp >find mydor/ -name "*php"     mydor/es/c/packags.php     mydor/etns/inx.php     mydor/pacepors.php     mydor/XAE.php          ~/tmp >find mydor/ -name "*php" -exec echo {} \;     ~/tmp >find mydor/ -name "*php" -exec echo "{}" \;     ~/tmp >find mydor/ -name "*php" -exec echo '{}' \;          ~/tmp >          ~/tmp >find --version     find (GNU findutils) 4.5.11     Packaged by Cygwin (4.5.11-1)     Copyright (C) 2012 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.          Written by Eric B. Decker, James Youngman, and Kevin Dalley.     Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)


Yanking URLs in w3m

I have been using w3m for a couple of weeks and am convinced that it is my preferred text browser - with one exception. Is there any way to yank URLs to the clipboard _without using the mouse_? I have looked through the manual and, using the default keybindings, there doesn't appear to be any documented way to do this. Has anyone developed a script to work around this?


How can I return a specific error code at this point in my TCL script?

I have a TCL expect script that runs a scp command for uploading a config file to my DNS server:               #!/usr/bin/expect -f          set config "~/dnsmasq.conf"          spawn /usr/bin/scp "$config" root@192.168.1.1:/etc/dnsmasq.conf          expect {         -re ".*yes.*no.*" {             exp_send "yes\r"             exp_continue         }         -re ".*password.*" {             exp_send "$password\r"             expect {                 -re ".*denied.*" {                     exit 7                 }             }         }     }      I would like to return a specific error code if the scp utility can not be found. Currently the script exits with a status of 1. If the script exits with a status of 7, I can handle that because I know it's an access denied error. The error that shows up in the Apache log is:               couldn't execute "/usr/bin/scp": no such file or directory         while executing     "spawn /usr/bin/scp "$config" root@192.168.1.1:/etc/dnsmasq.conf"      How can I return an error code of 5 or something at this point?


Quit VIM is slow, usually 2 seconds, it shows

On quit, vim shows that: > ".netrwhist" [Not edited] --No lines in buffer-- This process usually takes 2s. How to turn this thing off? --- Update --- I noticed that netrw is installed as system-wide. Use the code below to disable all of those plugins.               se nolpl     let x = &rtp     se rtp-=$VIMRUNTIME     ru! plugin/**/*.vim     let &rtp = x     unl x


What ~/.config refers to and how to put files there?

I want to set up a plugin for the Geany editor on a Debian system. It's a theme changing plugin, so I am following this manual. It says: > The simplest way to do this is to copy the contents of the archive into the > ~/.config/geany/filedefs/ folder. I don't understand this. What do they mean by `~/.config`? Is that the default directory where Geany is installed? I have its files at `/usr/lib/geany` but that doesn't seem to be location they are talking about.


Linux user interface programming? (esp. for Python and Fortran)

What are my options for programming a GUI in Linux? I have several programs in Fortran and Python that I would like to create simple UI's for. I also plan on incorporating graphics in the form of plots.


How to prepare a new MicroSDXC card for use with Android?

After buying a 64 GB MicroSDXC card and plugging it into my Android phone, it wasn't recognized. What do I need to do to use the space on this device? Many articles suggest installing closed source Windows programs for this, but I suspect it should be easy on Linux.


How much RAM can an application allocate on 64-bit x86 Linux systems?

Is it true that a single application can not allocate more than 2 GiBs even if the system has GiBs more free memory when using a 32-bit x86 PAE Linux kernel? Is this limit loosened by 64-bit x86 Linux kernels?


Is there a way to tell which file (script, specifically) executed a command?

I'm running Slackware 13.37, and I was wondering if there was a way to tell which script executed a command. I tracked the process and its arguments, but I would like to know where the command originated from.


Need help with this script

I'm supposed to write a bash script that has as an argument a path to a directory which contains a file named _checking.txt_. It needs to return the following exit codes:   * 4, if the directory doesn't exist   * 5, if that directory is not a subdirectory of /home/user5/task05/   * 6, if _checking.txt_ doesn't exist How can I write these conditionals ?


How did the system settings directory on UNIX come to be named /etc?

> **Possible Duplicate:**   >  What does etc stand for? And why isn't it named /cnf or /syscf or /cfg? No one I have ever asked has been able to tell me, not that I have access to any of the minds that created UNIX. When I was a youngster, I saw the /etc and assumed it was for 'et cetera', namely, other files that had no place elsewhere, and I used it for that in a few of my early Linux installs (cringeworthy, I know) in the mid-90's. I continued learning and trying to do better, and I have, since. But the mystery remains, and even the FSSTND does not seem to contain this info. Anyone?


What is the meaning of /etc (as acronym)

> **Possible Duplicate:**   >  What does etc stand for? What does it mean? All I can think is _etcetera_. By my teacher told me that there is a more appropriate meaning.


How to enable user_xattr in Mint Cinnamon?

I just installed Netflix Desktop on my Cinnamon Mint, but I can't start it. When I run the program, I get the following message: > It appears that you do not have extended file system attributes enabled. > Please enable the user_xattr option for your filesystem and try again. I tried to edit the `fstab` file as told in a couple different posts, but they don't work; I don't have a line that looks like this in my file:               UUID=94f7fc1e-fa27-4b24-99f3-4b461665a4a4       /       ext4    errors=remount-ro,user_xattr       0       1      And when I add it and restart, nothing changes.


Can I use Synaptics' output in KVM?

I have been looking at MenuetOS, a simple graphical OS written entirely in FASM. The only reason I don't actually use it is that its touchpad support is pure garbage: every time I try to run MenuetOS, I struggle to control the cursor and I have difficulty doing simple things like closing windows. There is no keyboard-based navigation interface that I am aware of. Obviously I won't be able to run MenuetOS on this hardware, but I hoped I could run it in KVM. KVM normally allows the OS to use the input from the touchpad directly, so it doesn't solve the problem, but I was hoping that I could get X to intervene. Is it possible to force KVM to use the cursor position data generated by X's Synaptics touchpad driver instead of the raw touchpad input?


How to remove an audio track from an mp4 video file?

I have an mp4 video file with multiple audio tracks. I would like to strip away the rest of the tracks and keep just one. How do I do this?


What is the most advanced video editing FLOSS?

There are so many video editors out there (at least half a dozen during my search), and I wonder which is the most advanced among them? How does it compare with commercial offerings?


Poor Man's GNU Parallel implemented in ksh?

I'd like to use the feature of GNU parallel where it can execute the command and the list it's fed in parallel and spit it out after it's all done, however, I don't want to install GNU parallel across all of our servers. Or perhaps a parallel version of `xargs`? Is there a ksh implementation of what GNU Parallel does? In this case, it doesn't have to be done in order as GNU Parallel does -- just as long as all the output can be piped or stored. I'd also like to avoid using temporary files.


Why linux is a monolithic kernel, while you can load/unload modules (e.g. drivers)?

Hybrid- and Microkernels are flexible, in the way one can add any higher-level functionality as a module, is it not the same for linux kernels? Why then linux is called a monolithic?


Block network access of a process?

Is it possible to block the (outgoing) network access of a single process?


Block specific application with iptables

I have to harden a Linux desktop as an assignment in my college. But I got stuck at a specific problem: I have to control the outgoing traffic with iptables. It should be possible to prevent a specific application (like LibreOffice) to access the internet. My professor said "look for the 'match' option". But I can't figure out how to do it. I thought of setting a rule which drops all packets of a specific group id with the `-m owner --owner-gid` option. But how can I configure my applications to run under this particular group? Or is this just the wrong way to do it? The OS is Debian 7.


grep surrounding characters of a match

I'm looking to do a find and replace within a giant database dump, and it's not doing what I think should happen. I'd like to grep for my target string in the file, and then see the surrounding 8 characters or so (I might need to adjust that number, depending). How can I do that? The reason I can't eyeball this is because there are many hundreds, if not thousands of matches. I want to get some number of characters surrounding the string, and then pipe it into `uniq` or something to see why my find and replace is having unexpected behaviors. Also, there can be multiple matches on the same line!


file type determine

As part of the product, there were several scripts which was provided. In one of the scripts, I've found the following line which seems not to work properly               find . -name *.old -type f -mtime +7 | xargs compress -f      when executing the `file` command on one of the *.old files I get the following result: `ASCII text, with very long lines` Do you have any suggestion what could be done?


Aliases interpretation

I have a few aliases in `.bash_aliases`. I defined `c` alias as follows, but it does not work as it should:               ...     alias cd='cd; ls -r --time=atime'     alias c='cd'     ...      In `.bashrc` there is a line:               alias ls='clear; ls --color=auto'      Commnand `c` gives bad output now. It should give the same output as `cd; clear; ls -r --time=atime --color=auto`. Other problem: When I type `cd dir` I should stay in `dir` but I'm in `$HOME` as a result. How can I solve this and improve in defining aliases? Is `.bash_aliases` interpreted as a `regular grammar`?


Long gcc compile time

So far my compilations have either succeeded or failed but his time it just got stuck. I'm compiling gcc on a Linux Synology NAS. However, the compilation process has run for 3 days and I start to think that it will never finish. From ps I get the following output:               27513 root      2536 S    /opt/bin/bash -c r=`${PWDCMD-pwd}`; export r; \ s=`cd .; ${PWDCMD-pwd}`; export s; \ if test -f stage1-lean  ; then \   echo Skipping rebuild of     27866 root      2468 S    /opt/bin/bash -c build/genautomata ../.././gcc/config/rs6000/rs6000.md \   insn-conditions.md > tmp-automata.c     27867 root      432m D    build/genautomata ../.././gcc/config/rs6000/rs6000.md insn-conditions.md     31539 root      2924 S    grep build      The last write to tmp-automata.c was 2.5 days ago. The NAS has only 64 MB RAM so I expected long compile time but not at this level. The average CPU load for the build process is 5-10%. What could be wrong? How do I troubleshoot?


Count the number of executable programs in a directory

How can I count the number of executable regular files in the current directory in a shell script?


Advanced usage/command of shell

> **Possible Duplicate:**   >  Is there any book , Tutorial on very very advanced shell scripting Is there a way/book to learn advanced usage of shell by practice? I find that most shell programming books only teach you the grammar of shell script. Grammar is important but as in C programming the standard library is also important.


less freezes at last line when paging output from a running command

I have a CLI app that produces lots of debug output and I have a really big need to search in the output. I'm using `less` for that but it freezes when I reach the last line with `j` or `G`. And it returns back to live only after `Ctrl`+`c`, but that way I kill my app. The problem can be easily reproduced when paging output from `find`, just use `G` right after running it.               find / | less      Is it a bug in `less`?


How to defer variable expansion

I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as:               str1='I went to ${PLACE} and saw ${EVENT}'     str2='If you do ${ACTION} you will ${RESULT}'      and then later on `PLACE`, `EVENT`, `ACTION`, and `RESULT` will be set. I want to then be able to print my strings out with the variables expanded. Is my only option `eval`? This seems to work:               eval "echo ${str1}"      is this standard? is there a better way to do this? It would be nice to not run `eval` considering the variables could be anything.


sudo -E cannot excute some commands located in home dir?

symptom:               $ sudo -E adb     sudo: adb: command not found          $ which adb     /home/usr/opt/android/platform-tools/adb          $ sudo -E echo ${PATH}     ...:/home/usr/opt/android/platform-tools          $ stat ~/opt/android/platform-tools/adb     Access: (0775/-rwxrwxr-x)  Uid: ( 1000/ usr)   Gid: ( 1000/ usr)      @richard, thanks. I did this:               $ echo 'echo $PATH' | sudo sh     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin     $ echo 'echo $PATH' | sudo -E sh     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin      so it is not in the path of sudo. But how can I make the sudo respect the PATH temporarily?


How to make an entry of Slackware into grub2

I want to manually add the Slackware entry into the GRUB2 configuration file `/boot/grub/grub.cfg`. But the problem is that there is no initrd or initramfs present in `/boot` directory of Slackware. I saw that there is some utility named `mkinitramfs` which generates the initramfs, but I don't know how to use it for a kernel which is not running and is placed at a particular folder. Can somebody please help me out in solving my problem.


Can't explain "crash" entries in output of the 'last' command

Last shows "crash" at 12:02 and 14:18, but the system didn't stop working at that time. The reboot at 15:03, on the other hand, was to recover from an actual crash - our system stopped responding at 14:46. Why does last show two "crashes" prior to the actual crash of the machine?               [admin@devbox log]$ last | head     myuser pts/2        myhostname  Wed Sep 28 15:12   still logged in     myuser pts/2        myhostname  Wed Sep 28 15:09 - 15:12  (00:02)     myuser pts/2        myhostname  Wed Sep 28 15:07 - 15:09  (00:01)     myuser pts/1        myhostname  Wed Sep 28 15:06   still logged in     myuser pts/0        myhostname  Wed Sep 28 15:04   still logged in     reboot   system boot  2.6.18-274.el5PA Wed Sep 28 15:03          (00:09)     myuser pts/1        myhostname  Wed Sep 28 14:18 - crash  (00:44)     myuser pts/0        myhostname  Wed Sep 28 12:02 - crash  (03:01)      EDIT: The reboot at 15:03 is real enough - but the two "crash" entries at 14:18 and 12:02 I can't explain.


Debian sheevaplug internet not working

I have a sheevaplug with debian 5.0..internet was always working fine until today. I have a bunch of pcs connected via wireless to my router and internet works fine. From today though my debian won't connect to the internet and i have no idea why... when I run `ping google.com` I get this:               ping google.com     PING google.com (173.194.35.8) 56(84) bytes of data.     ^C     --- google.com ping statistics ---     443 packets transmitted, 0 received, 100% packet loss, time 442006ms      It stays like this forever and I am unable to wget anything. Here is some info that might be useful : Content of `/etc/network/interfaces`:               # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or     # /usr/share/doc/ifupdown/examples for more information.     auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp      Output of `ifconfig`:               eth0      Link encap:Ethernet  HWaddr f0:ad:4e:01:40:78               inet addr:192.168.2.12  Bcast:192.168.2.255  Mask:255.255.255.0               inet6 addr: fe80::f2ad:4eff:fe01:4078/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:2200 errors:0 dropped:0 overruns:0 frame:0               TX packets:2926 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:229615 (224.2 KiB)  TX bytes:466378 (455.4 KiB)               Interrupt:11          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      Content of `/etc/resolv.conf`:               nameserver 192.168.2.1      Here is the output of `netstat -rn`:               debian:~# netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0      Output of `arp -na`:               debian:~# arp -na     ? (192.168.2.1) at 00:1a:2a:27:c0:68 [ether] on eth0      Output of `route`:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.2.0     *               255.255.255.0   U     0      0        0 eth0     default         .               0.0.0.0         UG    0      0        0 eth0      I tried everything : static IP, restarting network connection, restarting router, no luck... Any ideas what might be wrong? * * * **Edit** : Here's the output of `route`:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.2.0     *               255.255.255.0   U     0      0        0 eth0     default         .               0.0.0.0         UG    0      0        0 eth0      * * * **Edit** : Here's the output of `netstat -rn`:               debian:~# netstat -rn     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0     0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 eth0      and `arp -na`:               debian:~# arp -na     ? (192.168.2.1) at 00:1a:2a:27:c0:68 [ether] on eth0


Adding a self-signed certificate to the "trusted list"

I've generated a self-signed certificate for my build server and I'd like to globally trust the certificate on my machine, as I created the key myself and I'm sick of seeing warnings. I'm on Ubuntu 12.04. How can I take the certificate and globally trust it so that browsers (Google Chrome), CLI utilities (wget, curl), and programming languages (Python, Java, etc.) trust the connection to https://mysite.com without asking questions?


Is there any way of prompt a message when a command in /usr/sbin/ is tried to run as nonroot?

In most Linux distros I've used when you type for example _ifconfig_ as a normal user, you get a prompt message telling you that only root can execute such command. In Debian, it only says command not found (because it's looking for it in /usr/bin/). I'm wondering if there is any way for prompt a message, like "ifconfig must be run as root" or something like that.


How can I fix the location of polkit and glib include headers?

I am developing an application in which I require to use PolicyKit and it appears PolicyKit uses Glib libraries. What happens is that I installed PolicyKit, but the location of the headers are on `/usr/include/polkit-1/` and `/usr/include/glib-2.0`. and the headers have on their inside locations like `/usr/include/`, `/usr/include/polkit`, `/usr/include/gobject`. I can't compile because the compiler doesn't find the headers in the location the headers say they are supposed to be. I tried modifying each header individually, but its taking too long and I don't know when I'll be done. The problem here is that when they are installed, they are installed in `/usr/include/polkit-1` and `/usr/include/glib-2.0` when they are supposed to be installed in `/usr/include` alone. In other words, the folder `polkit-1` and `glib-2.0` shouldn't be there. Anyone know of anyway to fix this quickly by putting the files and folders in their respective locations?


How to pass data outside process for zenity progress?

Usually this would be a question about how to pass data from a subprocess to a main process, but maybe `zenity` has some extra quirks so please focus on `zenity`. Example:               #!/bin/sh     (     echo "10" ; sleep 1     echo "# Updating mail logs" ; sleep 1     echo "20" ; sleep 1     echo "# Resetting cron jobs" ; sleep 1     echo "50" ; sleep 1     echo "This line will just be ignored" ; sleep 1     echo "75" ; sleep 1     echo "# Rebooting system" ; sleep 1     echo "100" ; sleep 1     ) |     zenity --progress \       --title="Update System Logs" \       --text="Scanning mail logs..." \       --percentage=0          # ... here main process continues (x)      Each step in practice can fail (there is more than just an echo -- tar, computing md5, zipping, unzipping, you name it), and I would like to set, for example, variable ERR to some message and quit the progress subprocess, and after that display content of ERR and quit for good. The problem is, ERR is local variable, so I can break the subprocess, but nevertheless I cannot pass ERR outside. I cannot also display it locally, because the main script will continue anyway, unaware that the subprocess failed. So the question is, how can I pass an error code, message, anything to the main process (continuing at the (x) point)? Process substitution:               #!/bin/sh     zenity --progress \       --title="Update System Logs" \       --text="Scanning mail logs..." \       --percentage=0 < <(     echo "10" ; sleep 1     echo "# Updating mail logs" ; sleep 1     ...      This didn't work for me too, i.e. ERR was not visible to the main script.