Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. $ multixterm
  2.  
  3. max_processes=20
  4. for ((i=0; i<$max_processes; i++))
  5. do
  6. /path/to/myprog arg1 arg2 > /tmp/myprog.${i}.log &
  7. done
  8.  
  9. vi ~/.screenrc
  10. screen -t inst1 1 /path/to/myprog arg1 arg2
  11. screen -t inst2 2 /path/to/myprog arg1 arg2
  12. screen -t inst3 3 /path/to/myprog arg1 arg2
  13. screen -t inst4 4 /path/to/myprog arg1 arg2
  14.  
  15. :setw synchronize-panes on
  16.  
  17. #!/bin/bash
  18.  
  19. prog="/path/to/myprog"
  20. args="argument1 argument2"
  21. max=100
  22. for i in $(seq $max); do
  23. if [ $i -lt $max ]; then
  24. exec $prog $args &> /dev/null &
  25. else
  26. exec $prog $args
  27. fi
  28. done
  29.  
  30. #!/bin/bash
  31.  
  32. checkfile() {
  33. if [ ! -f $1 ]; then
  34. echo "could not find $1"
  35. exit 99
  36. else
  37. echo "OK"
  38. fi
  39. }
  40.  
  41. # Check for App1 XML
  42. echo -n "Checking for App 1 XML... "
  43. XMLA=/domain/DM.xml
  44. checkfile ${DEVROOT}/${XMLA}
  45.  
  46. # Check for App2 XML
  47. echo -n "Checking for App 2 XML... "
  48. hostname=$(hostname)
  49. XMLB=/domain/DM_${hostname}.xml
  50. checkfile ${DEVROOT}/${XMLB}
  51.  
  52. # Launch Konsole
  53. echo -n "Launching konsole... "
  54. K=$(dcopstart konsole-script)
  55.  
  56. [ -z "${K}" ] && exit 98
  57. # Create second tab and resize
  58. SDA=$(dcop $k konsole currentSession)
  59. SDB=$(dcop $k konsole newSession)
  60. dcop $K $SDA setSize 121x25
  61.  
  62. # Let bash login, etc.
  63. sleep 1
  64.  
  65. # Rename the tabs
  66. dcop $K $SDA renameSession "App 1"
  67. dcop $K $SDB renameSession "App 2"
  68.  
  69. # Start services, letting user watch
  70. echo -n "starting app1... "
  71. dcop $K konsole activateSession $SDA
  72. dcop $K $SDA sendSession "echo -ne '33]0;DEV (${hostname})07' && clear && starter $XMLA"
  73. sleep 2
  74. echo -n "starting app2... "
  75. dcop $K konsole activateSession $SDB
  76. dcop $K $SDB sendSession "echo -ne '33]0;DEV (${hostname})07' && clear && starter $XMLB"
  77. echo done.
  78.  
  79. sh <<-STRESS &
  80. $( printf 'myprog &n%.0b'
  81. `seq 1 ${MAX_CONCURRENT_PROCS}` )
  82. STRESS
  83. echo "$!"
  84.  
  85. nohup ./myprog -arg1 -arg2 &
  86.  
  87. [1] 1769
  88. nohup: ignoring input and appending output to 'nohup.out'
  89.  
  90. kill 1769
  91.  
  92. fg %1
Add Comment
Please, Sign In to add comment