remove title bar of another program

I have developed a program with glut library and want to remove its title bar. Since its impossible to remove the title bar from glut library I have to use an external tool to remove its title bar. Regarding the fact that it is possible to manipulate other windows decoration in Windows operating system I hope to find a similar remedy for this obstacle. Do you have any Idea about how to remove specific window title bar with a script or a simple X11 application ?


how to set up ldap and trac

I have set up kerberos authentication with `trac` which works well. Now I want to use AD groups and users for `trac` permissions using the `trac` plugin Configuration for `LdapPlugin`. I have been following this guide but it is not working. I am using `trac 0.10.4`. In my apache, I have the following:               <LocationMatch "/trac/[^/]+/login">             AuthType Kerberos             AuthName Trac             KrbServiceName HTTP/intranet.domain.com             KrbMethodNegotiate On             KrbMethodK5Passwd On             KrbAuthRealms DOMAIN.COM             Krb5KeyTab /etc/httpd/conf/intranet.keytab             AuthzLDAPAuthoritative off             require valid-user             Options Indexes MultiViews FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all             SetOutputFilter DEFLATE     </LocationMatch>      My `trac` configuration:               [root@hero plugins]# cat ../conf/trac.ini      [components]     ldapplugin.* = enabled          [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domain= domain.com          [ldap]     global_perms = true     enable = true     use_tls = false     host = echo     port = 389     basedn = dc=domain,dc=com          # Relative DN for users (defaults to none)     user_rdn = ou=TechSupport,ou=Woking,ou=Sites          # Relative DN for group of names (defaults to none)     group_rdn = cn=users          # objectclass for groups     #groupname = groupofnames          # dn entry in a groupname      #groupmember = member          # attribute name for a group     #groupattr = cn          # attribute name for a user     #user_name_attr = uid          # objectclass for user ; customize to your needs     #user_class = sambaSamAccount          # attribute name to store trac permission     #permattr = tracperm          # filter to search for dn with 'permattr' attributes     #permfilter = objectclass=*          # time, in seconds, before a cached entry is purged out of the local cache.     #cache_ttl = 900          # maximum number of entries in the cache     #cache_size = 100          # whether to perform an authenticated bind for group resolution     #group_bind = false          # whether to perform an authenticated bind for permision store operations     store_bind = true          # user for authenticated connection to the LDAP directory     bind_user = cn=administrator,cn=users,dc=domain,dc=com          # password for authenticated connection     bind_passwd = ********          # global permissions (vs. per-environment permissions)     #global_perms = false          # group permissions are managed as addition/removal to the LDAP directory groups     #manage_groups = true          # whether a group member contains the full dn or a simple uid     #groupmemberisdn = true          [trac]     permission_store = LdapPermissionStore      If I change the httpd configuration to `ldap` I get the following error:               [Mon Dec 02 14:13:33 2013] [warn] [client 172.16.0.85] [19659] auth_ldap authenticate: user sharifu authentication failed; URI /trac/paradox/login [ldap_search_ext_s() for user failed][Operations error], referer: http://intranet/trac/paradox/          <LocationMatch "/trac/[^/]+/login">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all             AuthLDAPURL "ldap://echo:389/dc=domain,dc=com?uid"             AuthzLDAPAuthoritative on             require valid-user     #               Options Indexes MultiViews FollowSymLinks     #        AllowOverride All     #               SetOutputFilter DEFLATE     </LocationMatch>      I believe I am doing something wrong in the `trac.ini` file if I use kerberos authentication in apache. I have now done the following and managed to get authentication working using `ldap` in apache. I just need some help implementing this into `trac` to use permission on AD groups etc.               <LocationMatch "/trac/[^/]+/login">             AuthType Basic             AuthName Trac             AuthBasicProvider ldap             Order allow,deny             Allow from all                  AuthLDAPURL "ldap://echo.uk.domain.com akutan.usa.domain.com/ou=Sites,dc=domain,dc=com?sAMAccountName"             AuthLDAPBindDN cn=Administrator,cn=Users,dc=domain,dc=com             AuthLDAPBindPassword **********                  AuthzLDAPAuthoritative off             require valid-user     </LocationMatch>          [root@hero trac]# trac-admin paradox permission list          User             Action              --------------------------------     @Administrators  TRAC_ADMIN          anonymous        CHANGESET_VIEW      anonymous        FILE_VIEW           anonymous        LOG_VIEW            anonymous        MILESTONE_VIEW      anonymous        REPORT_SQL_VIEW     anonymous        REPORT_VIEW         anonymous        ROADMAP_VIEW        anonymous        SEARCH_VIEW         anonymous        TICKET_VIEW         anonymous        TIMELINE_VIEW       anonymous        WIKI_VIEW                Available actions:      BROWSER_VIEW, CHANGESET_VIEW, CONFIG_VIEW, FILE_VIEW, LOG_VIEW,      MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE, MILESTONE_MODIFY,      MILESTONE_VIEW, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE, REPORT_MODIFY,      REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW, SEARCH_VIEW,      TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, TICKET_MODIFY,      TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE,      WIKI_DELETE, WIKI_MODIFY, WIKI_VIEW      I have forgotton to enable the plugins, however I am having trouble `trac` talking to `ldap`. In the log, I get the following:               Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] ERROR: LDAP error: Operations error     Trac[paradox:api] DEBUG: Updating wiki page index      Current config:               [notification]     always_notify_owner = true     always_notify_reporter = true     always_notify_updater = true     mime_encoding = base64     smtp_always_bcc =     smtp_always_cc = sharif.uddin@domain.com     smtp_default_domain = domain.com     smtp_enabled = true     smtp_from = trac@domain.com     smtp_password =     smtp_port = 25     smtp_replyto = support@domain.com     smtp_server = hero.uk.domain.com     smtp_subject_prefix = __default__     smtp_user =     use_public_cc = false     use_short_addr = false     use_tls = false     #ignore_domains = domain.com          [ldap]     enable = true     host = echo     basedn = dc=domain,dc=com     user_rdn = ou=Sites,dc=domain,dc=com     group_rdn = cn=Users,dc=domain,dc=com     store_bind = true     bind_user = Administrator@domain.com     bind_passwd = ******          [trac]     permission_store = LdapPermissionStore          [logging]     #log_file = /var/log/trac.log     log_format = Trac[$(basename)s:$(module)s] $(levelname)s: $(message)s     #log_level = DEBUG     #log_type = file          [components]     webadmin.* = enabled     ldapplugin.* = enabled


cp doesn't work in script but works in terminal

Now, this is a strange problem, I have this kind of script:               CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"     RESOURCES_PATH="${CWD}/resources"          PROJECT_NAME="something"          DRUSH_ALIASES_EXAMPLE_PATH="${RESOURCES_PATH}/example.aliases.drushrc.php"     DRUSH_ALIASES_PATH="~/.drush/${PROJECT_NAME}.aliases.drushrc.php"          cp ${DRUSH_ALIASES_EXAMPLE_PATH} ${DRUSH_ALIASES_PATH}     echo "cp ${DRUSH_ALIASES_EXAMPLE_PATH} ${DRUSH_ALIASES_PATH}"      When I'm trying to run that kind of script, I'm getting error: "cp: Cannot create regular file "~/.drush/something.aliases.drushrc.php". There is no such file or directory" But the funny thing is, that if I will copy the output of "echo" and paste in directly into terminal, the command will work just fine. I'm confused, any ideas what can be wrong with above script?


Simulate bitrot/corrupt files (for BTRFS)

Is it possible to intentionally corrupt a file so that BTRFS will report a checksum error? I want to test a script that's supposed to find file names with checksum errors, but I don't have any corrupt files. EDIT: After a long time of searching I found the same question on AskUbuntu with some solutions. Unfortunately, I don't see any `btrfs-corrupt-block` utility, despite the fact that I have `btrfs-progs` installed.


Move extension-less files with mv

I have a folder with images(png, bmp, jpg) and extension-less files. I cant figure out how to move only the extension-less files. They are all random numbered files.


Preserve tcsh history in multiple terminal windows

How can we preserve or maintain the same history across multiple terminals? The same question, but for bash shell , were discussed in the below link Preserve bash history in multiple terminal windows let me know the corresponding settings for tcsh shell ?


In VI how do I paste text into my file from a range of lines I have yanked?

I am using vi in Solaris 10. I am yanking a range of lines by doing `283,295y`, and I do believe the `yank` command is working as it says `12 lines` after I execute the command. However when I try to copy the lines into the file `p` or `P` commands don't actually paste the yanked lines above or below the cursor!


create file from function

#!/bin/bash          # trims trailing spaces and tabs from file, using awk utility     function remove_trail() {          [ ! $# -lt 2 ] || { echo "Usage: $FUNCNAME file-to-trim out-file"; return 1; }              # args         in="$1"         out="$2"              # this check works fine...              [ -f "$in" ] && return 0 || { echo "File \""$in"\" does not exist."; return 1; }              # substitute tabs and spaces for nothing on $in arg, then output result to $out         awk '{ sub(/[ \t]+$/, ""); print }' "$in" >tmp && mv tmp "$out"         #however, after previous line I don't get my tmp file nor my $out file created.. WHY :O???         # give user a friendly message         echo 'Processing done.. Check your '"$out"' file.'     }      this function is defined in `.bashrc`, so I could use it daily as a kind of builtin.. so when I open shell I type remove_trail `file1` `file2` to get `file2` written from `file1`+removed_trailing_spaces.   My question is: Why I am not getting tmp and $out files created in my dir?


Where is the function given by "which prompt" defined?

I am used to using "which stuff" do find the file that will be called when I use "stuff". I was quite surprised to see "which prompt" respond with               prompt () {             local prompt_opts             set_prompt "$@"             (( $#prompt_opts )) && setopt noprompt{bang,cr,percent,subst} "prompt${^prompt_opts[@]}"             true     }      on my Archlinux system. Where does this come from, and how do I make the prompt command avaliable inside the chroot environment I am currently building? (I just copied the other commands into it... that does not work here =) ) **Edit:** I am using zsh as my shell, maybe that changes something.


Dell Inspiron 6400 wifi not working with Joli OS 1.2 - tried various fixes

I have been using Ubuntu, Xubuntu and Kubuntu a while now. I've just installed Joli OS on an old Dell inspiron 6400. I've read loads of fixes to get the wifi working but to no avail. I have tried the fix with the `b43` driver install in terminal, which didn't work, also tried to unintall and reinstall the bcmwl kernel. `lspci` shows:               mike@mike-jolicloud:~$ lspci      00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)      00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)     00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)     00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)     00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)      00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 01)     00:1d.0 USB Controller: Intel Corporation N10/ICH7 Family USB UHCI Controller #1 (rev 01)      00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)      00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)      00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)     00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)     00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)     00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)      00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)     03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)     03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller     03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)      03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 01)     03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)      03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)     0b:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01)


How do I stream a top snapshot into a file

Is there any way to persist the snapshot of `top` at that given moment into a file? I tried               top > top.out      but the contents were nothing like top in STDOUT:               ^[[H^[[2J^[(B^[[mtop - 16:09:49 up 18 days, 21:46,  4 users,  load average: 2.00, 1.90, 1.87^[(B^[[m^[[39;49m^[[K     Tasks:^[(B^[[m^[[39;49m^[(B^[[m 286 ^[(B^[[m^[[39;49mtotal,^[(B^[[m^[[39;49m^[(B^[[m   1 ^[(B^[[m^[[39;49mrunning,^[(B^[[m^[[39;49m^[(B^[[m 285 ^[(B^[[m^[[39;49msleeping,^[(B^[[m^[[39;49m^[(B^[[m   0 ^[(B^[[m^[[39;49mstopped,^[(B^[[m^[[39;49m^[(B^[[m   0 ^[(B^[[m^[[39;49mzombie^[(B^[[m^[[39;49m^[[K     Cpu(s):^[(B^[[m^[[39;49m^[(B^[[m  5.9%^[(B^[[m^[[39;49mus,^[(B^[[m^[[39;49m^[(B^[[m  0.1%^[(B^[[m^[[39;49msy,^[(B^[[m^[[39;49m^[(B^[[m  0.0%^[(B^[[m^[[39;49mni,^[(B^[[m^[[39;49m^[(B^[[m 93.5%^[(B^[[m^[[39;49mid,^[(B^[[m^[[39;49m^[(B^[[m  0.3%^[(B^[[m^[[39;49mwa,^[(B^[[m^[[39;49m^[(B^[[m  0.0%^[(B^[[m^[[39;49mhi,^[(B^[[m^[[39;49m^[(B^[[m  0.1%^[(B^[[m^[[39;49msi,^[(B^[[m^[[39;49m^[(B^[[m  0.0%^[(B^[[m^[[39;49mst^[(B^[[m^[[39;49m^[[K     Mem: ^[(B^[[m^[[39;49m^[(B^[[m 64322524k ^[(B^[[m^[[39;49mtotal,^[(B^[[m^[[39;49m^[(B^[[m 46529492k ^[(B^[[m^[[39;49mused,^[(B^[[m^[[39;49m^[(B^[[m 17793032k ^[(B^[[m^[[39;49mfree,^[(B^[[m^[[39;49m^[(B^[[m   141304k ^[(B^[[m^[[39;49mbuffers^[(B^[[m^[[39;49m^[[K     Swap:^[(B^[[m^[[39;49m^[(B^[[m  6289436k ^[(B^[[m^[[39;49mtotal,^[(B^[[m^[[39;49m^[(B^[[m      696k ^[(B^[[m^[[39;49mused,^[(B^[[m^[[39;49m^[(B^[[m  6288740k ^[(B^[[m^[[39;49mfree,^[(B^[[m^[[39;49m^[(B^[[m 15289220k ^[(B^[[m^[[39;49mcached^[(B^[[m^[[39;49m^[[K     ^[[6;1H


Change the highlight color in Elementary OS

When I hover the mouse in buttons or dropdown menus, the text's color changed to white but also the background of the text changed to white and make it unreadable. Look at the image in the right click menu of the mouse. The white area is the "save as" option and I have the mouse hovering it. Also, I have another problem, probably related with this one. When I have a form with radio buttons, I cannot see the checked one if the buttons are white. Probably the dot in the checked on is white and I cannot recognize which one is checked. ![Image](http://i.stack.imgur.com/CeYX9.png)


How can I configure avahi to resolve host name on adhoc network?

I have a linux machine (raspberry pi) running Debian and I have configured it to create an ad-hoc network. The machine hosts a web app which allows a person to scan for infrastructure networks and select one and enter security credentials. The raspberry pi will then connect up to the chosen network. I want to make it simple to get to the webpage hosted by the raspberry pi, regardless of whether it in ad-hoc mode or infrastructure mode. From what I have read, the best way to do this is to install `avahi-daemon` and configure it to resolve the hostname to it's own address. I have tried doing this but ran into some problems. When the pi is connected to an infrastructure I can run `ping raspberrypi.local` on my mac and get ping responses back from the pi. However, when the pi is in ad-hoc mode, and I connect my mac up to the adhoc network, the ping does not succeed. It seems as though avahi is only working with infrastructure networking mode. Here is my attempt: I added the following service definition in `/etc/avahi/services`:               <?xml version="1.0" standalone='no'?>     <!DOCTYPE  service-group SYSTEM "avahi-service.dtd">     <service-group>         <name replace-wildcards="yes">%h</name>         <service>             <type>_device-info._tcp</type>             <port>0</port>             <txt-record>model=RackMac</txt-record>         </service>         <service>             <type>_ssh._tcp</type>             <port>22</port>         </service>         <service>             <type>_http._tcp</type>             <port>80</port>         </service>     </service-group>      The avahi config file `/etc/avahi/avahi-daemon.conf` is the same as the default one but I tried adding the following:               allow-point-to-point=yes      which did not help. I thought maybe point-to-point was the same as peer-to- peer network, but maybe not? Does anyone have any suggestions? Edit: I'm not sure if it's important or not but I do also have dhcpd running when the Pi is in ad-hoc mode. Could this be a problem? Does avahi try to assign IP addresses?


Ubuntu 14.04 mouse pointer does not move

I'm using Ubuntu 14.04, after updating the Unity doesn't load. The sidebar and topbar disappear. On the main screen, there are only the background and the pointer. I've solved this problem by entering these commands               sudo apt-get update     sudo apt-get install --reinstall ubuntu-desktop     sudo apt-get install unity     sudo apt-get remove --purge nvidia*     sudo shutdown -r now      After rebooting, the side bar does appear, however now the mouse pointer disappears. I make the pointer visible by entering this command:               gsettings set org.gnome.settings-daemon.plugins.cursor active false      The mouse pointer now appears but it does not move (it freezes). Can someone guide me how to solve this problem ?


Is there any way I can obfuscate ".sh" shell script?

I'm running Ubuntu. I need to know any way to obfuscate `.sh` shell script file contents in order to make it very difficult to read. Any suggestion are welcome, including using online obfuscator.


zmv for zsh: Dry runs and man pages

I've heard great things about `zmv` in `zsh`, and would love to really learn to use it. However, I am still relatively unexperienced in zsh, and have some basic questions:   * Is there is a man page for `zmv` in `zsh` (man zsh outputs "No manual entry for `zmv`")   * Does `zmv` natively allow for dry runs?   * If the answer to the above is no, how would you test or do a dry run with `zmv` ?


Recovering from Sys Rq + r

I had a really bad lockup of my X server and had to do a Sys Rq + r to release my keyboard from X and get into a console. I was able to kill the process that was locking up my system, and continue my work in my still running X server. Now whenever I e.g. push Alt + F4 to kill a window, my system switches to the 4th console instead of killing the active window. So it seems that my keyboard still is in released mode. **How do I undo my previous Sys Rq + r command, such that I can continue my work in my running X server?**


When is an account displayed on the Unity login screen?

What are the exact rules for an account to be offered for login on the Unity login screen? I figured out:   * Locked accounts are still displayed   * Without password are still displayed   * Marked as /bin/nologin are still displayed However, the majority of the locked accounts like root, several service accounts etc are not displayed.


How can I switch to my USB headset automagically when it's plugged in?

I'm running Funtoo Linux, a Gentoo derivative. My two new Plantronics USB headsets (one wired, one wireless) work nicely. I plug one in, ALSA notices it, and if I manually set an application to use it instead of the default devices, it will. I'd prefer to simply have the headset become my default input/output when present, and have the default revert to my on-board speakers otherwise. How do I automate this kind of switch?


filename with no spaces from two command lines

I am running two Linux commands and I want to put the resulting values together in a filename with no spaces and a dot separating the two values. So far, I've got this:               pid=`sudo dmidecode -s system-product-name`     vid=`sudo dmidecode -s system-version`     # cleanup spaces in $pid and $vid     filename=$pid.$vid.tar.gz      How can I clean up the spaces in the two variables?


sudo to remember password for list of commands?

Is there a way in Linux to make _sudo_ command to remember the password the user entered for in the first of the lines? For example, for a list of commands that the user has to enter, the some of then requiring a _sudo_ prefix, how can one make sure that if the user copy+pastes the instructions into a terminal all in one go, is only asked the password once? Example:               mkdir ~/acpiinfo ; cd ~/acpiinfo     sudo acpidump > acpidump.txt     # enter password      sudo acpixtract acpidump.txt     ls *.dat | while read i; do iasl -d "${i}"; done     pid=`sudo dmidecode -s system-product-name`     vid=`sudo dmidecode -s system-version`     name=$pid.$vid     mkdir "${name}" && cp *.dsl "${name}"/      tar czf "${name}.tar.gz" "${name}"/ && ls -l "$( pwd )/${name}".tar.gz


Open xlsm file in linux?

For all my spreadsheet needs, I've found Open/Libre Office works fine, and I can receive xls and xlsx files from colleagues, and send files to them. However, I have recently been sent a large xlsm file, which is of course full of MS Excel macros, and so won't open in LibreOffice calc, which uses a different macro engine. Is there a linux application for such files? MS Excel under Wine? CrossOver? Something else?


Upstart Job as Unprivileged user fails with permission denied

I'm trying to set up a Sage Cell Server (an open source mathematical engine) running as an unprivileged user. I've created the unprivileged user `sagecell` to do the job. It is installed correctly and, if I run it normally using               sagecell@primary-server:~/sage/devel/sagecell$ ../../sage web_server.py      then everything works as expected. An interesting requirement of this application (that may or may not be relevant) is that it requires a passwordless ssh login (i.e., `ssh localhost` works). I've set up the unprivileged account with an ssh-key to do the job. Now, rather than manually making a screen session after booting up the server and running it in a screen session, I tried making an upstart job with this setup:               description "Sage Cell Server Starter"          start on runlevel [2345]     stop on starting rc runlevel=[016]          kill timeout 5          exec su -s /bin/sh -c 'exec "$0" "$@"' sagecell -- /home/sagecell/sage/sage /home/sagecell/sage/devel/sagecell/web_server.py      This, however, does not work. Looking at /var/log/upstart/sagecell.log gives the following error:               2013-02-20 00:11:09,665 sagecell:INFO starting tornado web server     Traceback (most recent call last):       File "/home/sagecell/sage/devel/sagecell/web_server.py", line 78, in <module>         application = SageCellServer()       File "/home/sagecell/sage/devel/sagecell/web_server.py", line 57, in __init__         kernel_timeout=kernel_timeout)       File "/home/sagecell/sage-5.7.rc0/devel/sagecell-main/trusted_kernel_manager.py", line 28, in __init__         self._sender = sender.AsyncSender() # Manages asynchronous communication       File "/home/sagecell/sage-5.7.rc0/devel/sagecell-main/sender.py", line 22, in __init__         self.router.bind(self.filename)       File "socket.pyx", line 489, in zmq.core.socket.Socket.bind (zmq/core/socket.c:4797)     zmq.core.error.ZMQError: Permission denied      EDIT: It should be noted that the application binds to port 8080 (and only 8080 as far as I'm aware). The important thing is that it works without privileges when I run it but not when Upstart runs it as the same user. Can anyone tell me why an application that works perfectly fine under the user `sagecell` fails to run under an upstart job running the script AS `sagecell`?


How to parameterize the LocalForward option in ssh_config?

I'm starting with this fully working ssh command:               $ ssh -fNL 3306:localhost:3306 coolio@database.example.com      This config gets me part of the simplification I am after:               Host tunnel         HostName database.example.com         IdentityFile ~/.ssh/coolio.example.key         LocalForward 3306 localhost:3306         User coolio      I can connect with this command, which is much better:               $ ssh -f -N tunnel      My present question is how can I parameterize it so I can do this (or similar):               $ ssh -f -N tunnel -p 3306      or:               $ ssh -f -N tunnel -p 5678      BTW, In my example up top I'm using the same port number in both places on purpose. That is what I need in this case. (But I would also like to know how to parameterize it if the ports are different.) What I tried so far:               Host tunnel         HostName database.example.com         IdentityFile ~/.ssh/coolio.example.key         LocalForward %p localhost:%p         User coolio      This gives the error: > ssh/config Bad forwarding specification Reference:   http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/


Unable to autocomplete ONLY when typing a make command

I'm running Ubuntu Linux 10.04. And I have the following in my .bashrc file:               if [ -f /etc/bash_completion ] && ! shopt -oq posix; then         . /etc/bash_completion     fi      I'm having a problem with autocomplete only when I type: make `Tab` For some reason it freezes and the only way to get out of that is to send a keyboard interrupt. The weird thing is I don't have any problems with autocomplete when executing any other programs... My question is there a specific reason for this? And is there a way to specifically change the autocomplete instructions for make? I looked at this question Autocompletion for Makefile rules in tcsh, but wasn't able to find the tcsh files anywhere on my system. This is the result from set-x and make `Tab`               make + local file makef makef_dir=. makef_inc cur prev i split=false     + COMPREPLY=()     ++ _get_cword     ++ '[' -n '4.1.5(1)-release' ']'     ++ __get_cword4     ++ local i     ++ local LC_CTYPE=C     ++ local 'WORDBREAKS=        "'\''><=;|&(:'     ++ WORDBREAKS='          '\''><=;|&(:'     ++ WORDBREAKS='          ><=;|&(:'     ++ '[' -n '' ']'     ++ local 'cur=make '     ++ local 'tmp=make '     +++ expr 'make ' : '.*[          ><=;|&(:]'     ++ local word_start=5     ++ '[' 5 -ge 2 ']'     ++ local char=e     ++ '[' e '!=' '\' ']'     ++ break     ++ cur=     ++ printf %s ''     + cur=     + prev=make     + _split_longopt     + [[ '' == --?*=* ]]     + return 1     + case $prev in     + false     + [[ '' == -* ]]     + (( i=0 ))     + (( i < 2 ))     + [[ make == -C ]]     + (( i++  ))     + (( i < 2 ))     + [[ '' == -C ]]     + (( i++  ))     + (( i < 2 ))     + (( i=0 ))     + (( i < 2 ))     + [[ make == -f ]]     + (( i++  ))     + (( i < 2 ))     + [[ '' == -f ]]     + (( i++  ))     + (( i < 2 ))     + '[' -n '' ']'     + '[' -n . ']'     + makef_dir='-C .'     + COMPREPLY=($( compgen -W "$( make -qp $makef $makef_dir 2>/dev/null      |              awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/     \                 {split($1,A,/ /);for(i in A)print A[i]}' )"             --     "$cur" ))     +++ make -qp -C .     +++ awk -F: '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \             {split($1,A,/ /);for(i in A)print A[i]}'


Can I use variables in crontab file?

I mean I want to use this variable at "minute to wday" in the following.               minute   hour    mday    month   wday    who command Because I want to set these values in some configuration file and want to use those time spans here.


How to disable portage LICENSE checks

Whenever I install a package with an EULA, portage asks me to add it to `package.license`:               The following license changes are necessary to proceed:      (see "package.license" in the portage(5) man page for more details)     #required by chrome-binary-plugins (argument)     >=www-plugins/chrome-binary-plugins-9999 google-chrome     #required by google-chrome (argument)     >=www-client/google-chrome-26.0.1410.40_beta189199:beta google-chrome      Since I don't read the licence anyway and portage isn't even asking me to do so, I'd like to globally disable this check. How to do that?


Adding printer from Gnome 3 on Debian Wheezy, Firewalld not running

I get an error trying to add a printer on Debian Wheezy that FirewallD is not running. I am trying to add a remote printer. There is no firewall on this computer, iptables blocks nothing, and there is no firewalld in the apt repository. Also system-config-printer, which apparently can work around this, is also no longer in apt-get.


Why message queues were not being used for any application?

In my Linux machine, when i run 'ipcs' command, I have the below information listed                srinivas@srinivas-G41MT-S2:~$ ipcs -a          ------ Shared Memory Segments --------     key        shmid      owner      perms      bytes      nattch     status           0x00000000 0          srinivas   600        393216     2          dest              0x00000000 32769      srinivas   600        393216     2          dest              0x00000000 65538      srinivas   600        393216     2          dest              0x00000000 6684675    srinivas   600        393216     2          dest              0x00000000 131076     srinivas   600        393216     2          dest              0x00000000 163845     srinivas   600        12288      2          dest              0x00000000 196614     srinivas   600        393216     2          dest              0x00000000 229383     srinivas   600        393216     2          dest              0x00000000 7208968    srinivas   600        262080     2          dest              0x00000000 7241737    srinivas   600        393216     2          dest              0x00000000 393226     srinivas   600        393216     2          dest                   ------ Semaphore Arrays --------     key        semid      owner      perms      nsems               ------ Message Queues --------     key        msqid      owner      perms      used-bytes   messages              srinivas@srinivas-G41MT-S2:~$            I do not understand why even a single application in my system is using Message Queues? I have so many applications installed and have them running(Ubuntu OS). I used Message Queues in one of my C application to transfer text messages between different threads. Since I saw this, I have a feeling that Message Queues may not be ideal for data transfer as no one is using them. Is it completely safe to use message queues? Is there any possibility of memory corruption if we do not implement them properly?


Multipath to a logical volume in a staging VM

How do I configure multipath in testing VM (purpose is purely academical)? I made new logical volume, modified `multipath.conf` to be as follows:               defaults {         udev_dir         /dev         user_friendly_names  yes     }          blacklist {     }          blacklist_exceptions {         device {             vendor "VMware,"             product "VMware Virtual S"         }     }      and `multipath -v3` says:               Apr 22 03:22:24 | sdb: rev = 1.0     Apr 22 03:22:24 | sdb: h:b:t:l = 2:0:1:0     Apr 22 03:22:24 | (null): (VMware,:VMware Virtual S) vendor/product whitelisted     Apr 22 03:22:24 | sdb: serial =      Apr 22 03:22:24 | sdb: get_state     Apr 22 03:22:24 | sdb: path checker = directio (config file default)     Apr 22 03:22:24 | sdb: checker timeout = 180000 ms (sysfs setting)     Apr 22 03:22:24 | sdb: state = running     Apr 22 03:22:24 | directio: starting new request     Apr 22 03:22:24 | directio: io finished 4096/0     Apr 22 03:22:24 | sdb: state = 3     Apr 22 03:22:24 | sdb: getuid = /lib/udev/scsi_id --whitelisted --device=/dev/%n (config file default)     Apr 22 03:22:24 | /lib/udev/scsi_id exitted with 1     Apr 22 03:22:24 | error calling out /lib/udev/scsi_id --whitelisted --device=/dev/sdb     Apr 22 03:22:24 | sdb: state = running     Apr 22 03:22:24 | /lib/udev/scsi_id exitted with 1     Apr 22 03:22:24 | error calling out /lib/udev/scsi_id --whitelisted --device=/dev/sdb     Apr 22 03:22:24 | sdb: detect_prio = 1 (config file default)     Apr 22 03:22:24 | sdb: prio = const (config file default)     Apr 22 03:22:24 | sdb: const prio = 1     Apr 22 03:22:24 | dm-0: device node name blacklisted     Apr 22 03:22:24 | dm-1: device node name blacklisted     Apr 22 03:22:24 | dm-2: device node name blacklisted     ===== paths list =====     uuid hcil    dev dev_t pri dm_st chk_st vend/prod/rev            dev_st           2:0:0:0 sda 8:0   1   undef ready  VMware,,VMware Virtual S running          2:0:1:0 sdb 8:16  1   undef ready  VMware,,VMware Virtual S running     [root@localhost ~]#       I want to configure multipath for logical volume on `/dev/sdb`. My blacklist is empty, why does it say that `dm-0/1/2` are blacklisted? Also, when I run `lib/udev/scsi_id --whitelisted --device=/dev` manually I got no errors. no output or changes either, though...


Colored output in less when tailing a logfile

I am in dire need of a way to color my less output while reading a file that is constantly being appended. The file in questions is a Resin servlet container log. My current "implementation" of the color scheme works using `tail -F` and `sed` for editing in colors around keywords. I have four words to color: `INFO, WARN, ERROR, DEBUG`, one of which occurs once per line. I have tried using the `LESSOPEN`environment variable, but I can't seem to keep reading the log. The file is not tailed once it has been open. I have very little control over the server, and cannot really install anything other than my own scripts in my home folder, so no packages. The server in question is a RHEL 6.4. The problem is that `less` does not keep reading the file. Is there a way to tail the log continuously using the `LESSOPEN`environment variable, or do I need some more complex tools?


What's the difference between lsof and fuser -uvm

Both shows the number of files we're using. Yet they both shows different results.               root@host [~]# lsof /home4     root@host [~]# lsof /home2     root@host [~]# lsof /home4      Then we got               fuser -uvm /home4                               root       2621 Frce. (root)crond                          root       2635 Frce. (root)atd                          root       4554 frce. (root)S99firstboot                          root       4768 .rce. (root)firstboot                          root       6533 .rce. (root)setup                          root      11042 Frce. (root)leechprotect                          root      11049 Frce. (root)httpd                          root      17885 Frce. (root)httpd                          root      18163 .rce. (root)sshd                          root      18184 .rce. (root)bash                          nobody    18619 Frce. (nobody)httpd                          nobody    18679 Frce. (nobody)httpd                          nobody    18812 Frce. (nobody)httpd                          nobody    18821 Frce. (nobody)httpd                          nobody    18841 Frce. (nobody)httpd                          nobody    18843 Frce. (nobody)httpd                          nobody    18850 Frce. (nobody)httpd                          nobody    18869 Frce. (nobody)httpd                          nobody    18885 Frce. (nobody)httpd                          nobody    18901 Frce. (nobody)httpd                          nobody    18914 Frce. (nobody)httpd                          root      18932 .rc.. (root)flush-7:0                          root      30728 Frce. (root)cphulkd                          root      30756 Frce. (root)cpsrvd-ssl                          root      30806 Frce. (root)cpdavd                          root      30833 .rce. (root)queueprocd                          root      30904 Frce. (root)tailwatchd                          root      30913 Frce. (root)cpanellogd      Where did I went wrong?


Why was -F removed from /sbin/shutdown?

I used to be able to run `/sbin/shutdown -r -F now` but in recent Ubuntu and Fedora releases there is no `-F` option and if I want to force an fsck I need to do `touch /forcefsck; /sbin/shutdown -r now`. Why was it removed?


Grub problem booting problem at fresh install of Centos

I've Windows 7 installed on my PC. I would like to install Centos and remove Windows 7 completely. After burning a Centos 6.2 on a DVD, and restarting the machine, I got the `grub>` window. I can not install Centos at all: I just see the grub prompt. However, on my laptop, the same DVD is giving me the graphical installation options. How can I install Centos on my PC?


iostat report huge writes to drives that's not even mounted

root@host [~]# fsck /home2     fsck from util-linux-ng 2.17.2     e2fsck 1.41.12 (17-May-2010)     /dev/sdb1: clean, 6018617/91578368 files, 54524459/366284000 blocks     root@host [~]# fsck /home4     fsck from util-linux-ng 2.17.2     e2fsck 1.41.12 (17-May-2010)     /dev/sdd1: clean, 8094369/91578368 files, 75999625/366284000 blocks      fsck returns no error               root@host [~]# lsof /home4     root@host [~]# lsof /home2      lsof returns no user               root@host [~]# mount     /dev/mapper/VolGroup-lv_root on / type ext4 (rw,relatime,usrjquota=quota.user,jqfmt=vfsv0)     proc on /proc type proc (rw)     sysfs on /sys type sysfs (rw)     devpts on /dev/pts type devpts (rw,gid=5,mode=620)     tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")     /dev/sda1 on /boot type ext4 (rw)     /dev/mapper/VolGroup-lv_home on /home type ext4 (rw,relatime,usrjquota=quota.user,jqfmt=vfsv0)     /dev/sdc1 on /home3 type ext3 (rw,relatime)     none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)     /usr/tmpDSK on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0)     /tmp on /var/tmp type none (rw,noexec,nosuid,bind)     sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)     root@host [~]# iostat -xk     Linux 2.6.32-279.19.1.el6.x86_64 (host.buildingsuperteams.com)  01/06/2013      _x86_64_        (16 CPU)          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               18.91    0.02   39.17   20.22    0.00   21.67      mount shows that there is sdd1 and sdb1 is not mounted               Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sda               0.16    11.93    1.35    3.30    53.91    59.92    48.95     0.10   21.87   3.70   1.72     sdb               0.49   219.57   22.00   99.14   224.17  1275.44    24.76     7.44   61.38   7.45  90.24     sdd               0.46   226.39   23.26   92.71   260.61  1277.34    26.52     0.67    5.77   7.71  89.40     sdc               0.00     1.79    0.28    0.05     5.03     7.38    74.28     0.00   14.34   2.05   0.07     dm-0              0.00     0.00    1.45   14.91    53.66    59.50    13.83     1.56   95.36   1.06   1.73     dm-1              0.00     0.00    0.04    0.10     0.18     0.41     8.00     0.00   21.25   2.44   0.04     dm-2              0.00     0.00    0.01    0.00     0.05     0.01     8.49     0.00    7.32   1.84   0.00      iostat report huge writes What would the reason be? I will replace the hard disk anyway. But this puzzles me to no end This caused a server crash already. I unmout the drive. iostat -x 1 shows empty, which is what's expected. So all this time I saw past data?


Running an .iso in Grub 2 (Truecrypt Recovery)

Backstory: I'm trying to recover a TrueCrypt installation. I've got the TrueCrypt recovery iso - and I'm trying to add that as a GRUB entry (I can still boot into Ubuntu on that same device) or run the TrueCrypt recovery iso from a USB stick. I have an iso file which I would like to boot from - so I've tried a couple things: http://jmesmon.github.com/2012/01/26/TCRD.html \- which suggests using memdisk{find} - but when I run the linux16 command in the grub CLI - I got a complaint about an incorrect magic value (so it's an apparently an unexpected input). How to boot from iso with Grub2/Burg boot loader \- which uses a loopback - which I pointed to my .iso file - but the auto-complete doesn't show anything in the loop once it is made. (This may be terribly incorrect - not sure) So I'm basically looking for grub commands to load a given iso. Any thoughts? Thanks!


using sed for replacing strings with "/"

need to replace < network> with a "192.168.61.0/24" but i am not able to do it with sed, tried                sed -i s/"< network>"/"192.168.61.0/24"/g file.sh      but this is not working,can some one please help me with correct syntax


Is there a less convoluted way to set the $path array locally within function?

Is there a less laborious way for setting a local version of the `$path` array than what's shown in the following snippet?               foo () {         local holdpath         holdpath=($path)         local path         path=($holdpath)         if ( some_condition ) path=( $PREFIX $path )              # do stuff     }      I'm referring specifically to the song-and-dance with `holdpath`... If instead I define               foo () {         local path=($path)         if ( some_condition ) path=( $PREFIX $path )              # do stuff     }      ...the first assignment to `path` triggers a `bad pattern` error. Of course, if instead I define               foo () {         local path         path=($path)         if ( some_condition ) path=( $PREFIX $path )              # do stuff     }      ...the first assignment to `path` makes no difference (i.e. it can be omitted without altering the results); with or without it, `$path` will be empty. EDIT: The following script tests the various suggestions I've gotten so far:               foo_0 () {       echo ${#path}       local PATH=$PATH       echo ${#path}     }          foo_1 () {       echo ${#path}       eval "local path; path=(${(q)path})"       echo ${#path}     }          foo_2 () {       echo ${#path}       eval "$(local -p path)"       echo ${#path}     }          for i ( 0 1 2 ) {       fn=foo_$i       echo "# $fn"       $fn       echo     }      The output is:               # foo_0     22     22          # foo_1     22     1          # foo_2     22     22      So the outputs for `foo_0` and `foo_2` are at least consistent with what I'm trying to achieve. Something is not working with `foo_1` as given above, but I get rid of the `(q)` in the assignment to `path`, i.e.               foo_1 () {       echo ${#path}       eval "local path; path=($path)"       echo ${#path}     }      ...then the output agrees with that of `foo_0` and `foo_2`. Unfortunately, even after reading the documentation for the `q` qualifier a couple of times, I don't quite understand what it's supposed to be doing in the original recipe. Also, I cannot understand why the following command-line variant of `foo_0` differs from the one above:               % (foo_0a () { echo ${#path}; local PATH=$PATH; echo ${#path} }; foo_0a)     22     1      FWIW, the corresponding command-line variants of `foo_1` and `foo_2` produce the same results as their originals in the script:               % (foo_1a () { echo ${#path}; eval "local path; path=(${(q)path})"; echo ${#path} }; foo_1a)     22     1     % (foo_2a () { echo ${#path}; eval "$(local -p path)"; echo ${#path}; }; foo_2a)     22     22      Also, in all the cases above in which `echo ${#path}` produces `1` instead of `22` the reason is that the local `$path` variable contains all the individual paths in a single string, separated by spaces.


What's the most efficient way to grep for two completely separate things and assign the values to separate variables?

CentOS 6.x I want to take the output from curl, grep for two completely separate strings, and assign their respective values as variables. What is the most efficient way to do this (without writing the output to disk)? Normally I would think of having a script with something like:               #!/usr/bin/env bash     foo1=$(curl https://domain.com/file.xml | grep string1)     foo2=$(curl https://domain.com/file.xml | grep string2)      But this ends up taking two passes and is horribly inefficient. Is there a better way? Hopefully a solution that involves fewer passes?


Delete Static Routes on Solaris 10

I have the following routes that I wish to delete:               10.250.0.0           10.250.0.37          UG        1          0      I have run the following to delete this with failure.               bash-3.2# route delete 10.250.0.0 -netmask 255.255.255.0 10.250.0.37     delete net 10.250.0.0: gateway 10.250.0.37: not in table      What is the cause for that failure?


Cron not running my script

I'm not sure why but my app never executes when I reboot my machine. In crontab               > crontab -e      I see               @reboot /root/myscriptname.sh      The file is               #!/bin/bash     nohup mono-sgen /root/myapp.exe /path/file > /dev/null 2>&1 &      I run               ps aux | grep mono      and I don't see my file. If i run /root/myscriptname.sh from the command line it runs fine. I tried using `bash /root/myscriptname.sh` in crontab but that didn't solve it. How do I execute `mono-sgen /root/myapp.exe /path/file > /dev/null 2>&1` without putting it in crontab (I want to leave it in a easy to disable sh file)


how to specify daemon dependency upon another daemon

in `/etc/init.d/` first daemon               # Provides:          first     # Required-Start:    $remote_fs $syslog      second daemon               # Provides:          second     # Required-Start:    $remote_fs $syslog first      Is this in debian the correct way to specify the dependency of the second daemon upon the first being launched before?


Run script on start up after everything else

OK, so there's a service (nagios) running on a Debian box that runs just fine, except for one very specific issue that only occurs after the box has been re- started. The issue is easily fixed by re-starting the service by hand. The problem itself is so specific and so confoundingly esoteric that I don't have the time to run it down (a single check out of 500+ comes back with a bug, but only when it's being run by nagios). Next best thing then, would be to have it re-start the service itself on startup, so no one has to do it by hand every time. So far I've tried to accomplish this by the following: Adding in "/etc/init.d/nagios restart" to the /etc/rc.local, this does run from looking at the logs, but doesn't fix the issue (must still be done by hand) Moving the timing for starting nagios to the very end (update-rc.d nagios defaults 99 10) Went back to the rc.local fix, this time adding in a "sleep 20" line, this does nothing but delay starting the box by 20 seconds. Anything else I can try/look at?


jenkins hook up with apache sites-enabled

I am trying to hook in jenkins into my currently configured site. My current site is located at `/var/www/aaronlote.com/checkout/` \- jenkins is building into `/var/lib/jenkins/workspace/aaronlote.com/` If I update my vhost to point to `/var/lib/jenkins/workspace/aaronlote.com/` I get a 403 error, the directory is unreadable. So I tried adding this as a build script in side the job:               rm -rf /var/www/aaronlote.com/checkout/     cp /var/lib/jenkins/workspace/aaronlote.com/ /var/www/aaronlote.com/checkout/      This runs but I have permission errors, e.g.               rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/router.js': Permission denied     rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/main.js': Permission denied     rm: cannot remove `/var/www/aaronlote.com/checkout/public/js/text.js': Permission denied      I then looked as using `sudo su` inside the jobs build but got errors and didn't think it was a great idea having jenkins running super user commands. Am I doing something obviously wrong or is there a way to get around this current set up issue I have?


Socksifying a qemu-kvm using tsocks

I'm trying to socksify a qemu-kvm using tsocks, but I have no success. I don't know if qemu access directly the hardware, skipping the OS or something like that, but I wasn't able to do this feat. I need a solution which socksify the kvm on host machine. Do you know guys if it's possible or I have to use another software/addon to work on it?


Transform directory structure

I have the following folder structure               root folder      |-al2        |- GER.zip        |- ENG.zip      |-ww        |- GER.zip        |- ENG.zip      and so on. The folder names are random strings. I want to sort the files in the following way:               root folder      |-ENG        |-al2          |- ENG.zip        |-ww          |- ENG.zip      |-GER        |-al2          |- GER.zip        |-ww          |- GER.zip      How can I automate this? **UPDATE** : The folder names do not follow any kind of system. They are random strings.


Graphical interface to YUM in Fedora 16

What are the options for managing `yum` software graphically in Fedora 16? and how can they be installed (if they aren't already)?


Where to download Linux Kernel source code of a specific version?

Is there a resource to download a specific kernel version source? For example, I want to get 2.6.36.2 sources to compare with this package and see what changes were introduced?


Delay Debian WiFi Networking Auto-Connect until after X and other applications are started

I've been profiling my boot times with bootchart and it seems that wpa_supplicant and dhcp take a significant amount of time during the boot process to get up and running and associate with my home router.               Here is my /etc/network/interfaces:     auto lo          iface lo inet loopback     iface eth0 inet dhcp          allow-hotplug wlan0     auto wlan0          iface wlan0 inet dhcp         wpa-ssid "ssid"         wpa-psk "password"      The connection works fine - it just takes awhile. I'm interested in optimizing boot time and don't need network until later. How can I delay the authentication process for WiFi until after I've started X and the system has booted? Here is my bootchart: ![enter image description here](http://i.stack.imgur.com/A3RmM.png)


Ping wireless interface from wired interface

I'm performing some wireless measurements. The setup I'm now using is composed of a WiFi AP and two laptops. One laptop (A) and the AP are connected to a common switch, while the second laptop (B) associate to the AP. Traffic is going from A to B and viceversa. I would like now to simplify the hardware requirements and replace both laptops with a single embedded PC based on OpenWRT. My question is then: is it possible to configure a Linux box to send packets out one interface (say the ethernet), over an AP and into another interface (say the wifi) on the same box?


Automating textual input from a bash script without using EOF

I'm running Ubuntu Linux. Suppose there is a program called `myprogram`. This program prompts the user for input; specifically, the user must type an integer when prompted and press `Enter`. I would like to automate this process using a bash script. In particular, I would like to execute `myprogram`, say, 100 times (using a counter `i` which goes from `1` to `100`). On each execution of `myprogram`, I would like to enter the current value of `i` when prompted. (By the way, `myprogram` takes options/switches `-options`, all of which will be constant and thus specified within the bash script.) An incomplete skeleton of this bash script might be:               #!/bin/bash     for i in {1..100}     do        myprogram -options     done      Now I would like to modify the above code so that the current value of `i` is entered when prompted by the program. What is the best way to do this? The website of the software I am using suggests using `<<EOF` at the end of the `myprogram -options` line. I think that this tells bash to look at the "end of the file" for the input to use. But what if I don't want to place the input at the **end** of the file? What if I would like to put it immediately after the `<<` or `<`? The reason is that things will get more complicated. For example, I may introduce an integer counter `j` that changes in some non-linear, non- sequential way. I would then want to feed the current value of `j` to `myprogram` on each iteration, but the value of `j` may change between the call to `myprogram -options` and the end of the file `EOF`. Do you have any suggestions?


What is the easiest way to set up a FTP server single signon pointing to /var/www?

I've tried following numerous tutorials found on the net. The setup always starts out simple like `sudo apt-get intstall vsftpd` and then goes into edditing the `/etc/vsftp.conf` file. This is where the tutorials fail me becasue most of them either leave the setup for the users `home` directory, or starts getting in the `chroot` setup which appears more complicated than I need. Some tutorials attempt to explain how to set the defualt path by simply saying "add `local_root=/var/www` in your config file" which I added to the end of the file. This causes the prompt to get stuck after entering the username. The problem here is that I don't know if the config directives have specific ordering. And if there is, the tutorials don't go into where it needs to be placed. I just need a single signon that points to the my `/var/www` Thanks!


How to delete a file with multiple colon signs in its name?

I have a folder with so many files whose name has multiple colon signs. For example: `Mail::Message::Field::Full.3pm.gz`. I wonder how to delete them. I have tried               rm Mail::Message::Field::Full.3pm.gz     rm Mail\:\:Message\:\:Field\:\:Full.3pm.gz     rm "Mail::Message::Field::Full.3pm.gz"      All with the same result: `rm: cannot remove 'Mail::Message::Field::Full.3pm.gz': Input/output error`. Also, I have tried with my normal user account and with root user. In both cases with the same result as above. `rm` with `-f` option has the same result. The same problem applies when renaming the files. And of course, I have writting permissions on that folder. The output of `ls -l` is               ls: cannot access Mail::Message::Field::Full.3pm.gz: Input/output error     -????????? ? ? ? ?            ? Mail::Message::Field::Full.3pm.gz      I do not know if this matter but the files are on a NTFS partition. * * * **Update** I do not think is a hardware issue. I am able to access (write, delete, create, decompress, etc) all other files. Although, I cannot access the problematic files.


How do I determine the size of kernel block?

I need to find out what the kernel block size is from vmstat output. I am specifically looking for kernel block size as defined in Block devices and block sizes. There it says all Linux blocks are currently 1024 bytes, but this is not true for old kernels. Is there a command I can use to view the kernel block size?


How to get mono-apache-server4 on debian

I installed mod-mono on debian via `apt-get install mono-apache-server2...` But when i do `apt-get install mono-apache-server4` it gives me: > E: Unable to locate package mono-apache-server4 Anyone know how I can get mono-apache-server4 on there?


Is it possible to change what tty a terminal emulator is connected to?

If I have a terminal emulator (say, `xterm`) by default it connects to a pseudoterminal like `/dev/pts/3` What I would like to know is if it is possible to connect it directly to, say, `tty1`? Could I connect to a `tty` and have it display the login prompt as if I was really at that `tty` (by pressing `Ctrl`+`Alt`+`F1` for example)?


Understanding SSH tunnels

I have linux (Ubuntu) server which I have root access to through ssh (port 22) only. On that server there is a MySQL database listening on port 3306. Is it possible to use putty (on my machine) and tunneling (on the linux machine) to create a tunnel from a local port on my machine (say 4000), to the linux server on port 22 and then from the server to itself on port 3306 ?


How to create a shortcut to a folder to Documents

I have a folder in `/media/sf_fedora` which I want to access from `Documents` instead of going into `/media` each time, how can I create a shortcut. The 'Make Link' is grayed out in the Edit menu for some reason.


Why does while [ 0 ] go into infinite loop?

I see the same behaviour for below loop as the loop with `while [ 1 ]`. Why is that so?               while [ 0 ]; do     echo "hello"     done


Is reading a file on UNIX faster than writing a file?

Sorry for the sheer simplicity of this question. A rather obtuse performance bottleneck has boiled down to this very small query. I have done some empirical analysis and I think I might be getting victimized by disk caching strategies. Fundamentally (if disk caching were disabled) would writing a file be as fast, slower, or faster than reading a file? I would assume that the answer would depend on the fragmentation (and file size) but the operation to write a file would have to do an additional look up of where the next free block is rather than just following the pointer to it. Any insight is appreciated.


Installation of Canon Laserjet LBP 2900B Printer drivers in Linux Mint-16-Cinnamon-64 bit

Respected and experienced folks, A bit of research on the net tells me to "install" Synaptic Package Manager from the Ubuntu Software Center to the above mentioned Linux Mint version! If it helps, this is the website that i visited: http://ubuntuhandbook.org/index.php/2013/07/canon-drivers-for-ubuntu-and- linux-mint/. Kindly, for my sake, browse the pinpointed topic there and advise! I know that Canon LBP 2900B printer is not in the list there, but nevertheless I request you to suggest(if there is one) a roundabout solution to installing any "CUPS" compatible with my lovely Cinnamon distro!


C shell script : how do I compare two strings?

I'm a C shell user. I've two files. file 1:               A     B     C     D     E file 2:               A     C     B     D     E I want to compare only `A-A`, `B-C`, `C-B`, `D-D`, `E-E` using a `for` loop. If the strings match, then print "match". The output would look like:               A A -> match     B C -> " "     C-B -> " "     D-D -> match     E-E -> match How do I use the `for` loop?


Is `rm -rf` not atomic?

I've just caught a confusing error:               rm: cannot remove `xxx/app/cache/prod': Directory not empty      which was caused by the following command:               rm -rf $cache_dir/*      where `$cache_dir` is defined as `xxx/app/cache` So I see it like: `rm` removed everything in `cache/prod` dir, then right before it attempted to remove the `cache/prod` directory - another program created a file/a directory inside it thus it caused `rm` failure. Is my assumption correct?


How to fix display error with GNOME Shell on Fedora 19?

I got the following problem: Well, just installed Fedora 19 alongside to my Debian installation. While GNOME Shell is working perfectly fine when running with Debian, there are some strange display errors (e.g. coloured backgrounds of icons; when opening the dash (where all installed applications are listed) the background not only darkens but turns completely black). ![Image describing the issue here.](http://abload.de/img/imag0187ewxcr.jpg) Some information about the actual machine running now Fedora 19: CPU: AMD Athlon 5050e, GPU: nVidia 7800GT (128 MB GFX RAM), RAM: 2 GB (I assume this is all information that's necessary, if not, please ask in the comments). Has anyone any ideas on how to fix this?


UNZIP failed while extracting

%> unzip V15679-01_3of3.zip     Archive:  V15679-01_3of3.zip       End-of-central-directory signature not found.  Either this file is not       a zipfile, or it constitutes one disk of a multi-part archive.  In the       latter case the central directory and zipfile comment will be found on       the last disk(s) of this archive.     unzip:  cannot find zipfile directory in one of V15679-01_3of3.zip or             V15679-01_3of3.zip.zip, and cannot find V15679-01_3of3.zip.ZIP, period.      Downloaded zip file and tried but it gave the above error.


adding SSL certificate for Github only (not all certificates from ca-certificates package)

I get the following error when accessing Github over HTTPS:               error: server certificate verification failed.      CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none      This is because I don't have any certificates in `/etc/ssl/certs/`. I know how to fix this problem. I can install the package `ca-certificates` from Debian repository. The problem is, however, that this will install all certificates (thousands) which I don't necessarily want to accept/trust. How can I install certificate for Github only? ### a Subproblem/Subquestion On another machine, where the package `ca-certificates` is already installed and git works, I have noticed that some certificates in `/etc/ssl/certs/` are one-certificate-per-file and other are many-certificates-in-one-file. The particular file containing Github certificate, `/etc/ssl/certs/ca- certificates.crt` contains over 150 other certificates:               $ grep 'BEGIN CERTIFICATE' /etc/ssl/certs/ca-certificates.crt | wc -l     159      How can I find which one out of these 159 certificate is the one I need? (other than brute force - slicing the file in halves and checking both halves, repeating `while n > 1`).


Execution time of pi calculation in shell scripts

I have to run a couple of command lines on a shell script on Ubuntu, one of those is a pi calculation. It works fine when i run it on terminal via the following cmd line:               time echo "scale=6500;4*a(1)" | bc -l      But when I run it on a script I get no luck. Typing in time before I execute the script i.e.               time ./filename.sh      isn't enough as I have to also run other commands in the script. Any suggestions?


How can I download all the software ( funtoo git repository) for offline use of funtoo, similiar to apt-mirror

I am working on a ship so once at sea I have no internet. The idea is to clone the complete git repository so that I can still install software when offine. I am using apt-mirror with debian which works great. I am looking to do something similiar with gentoo.


Control-space on Cinnamon

I installed synapse on my Cinnamon desktop, and everything worked with the keyboard shortcut `Ctrl`+`Space`. Then, at some point, it stopped working properly, and I had to hold down Control and hit space twice. Now it isn't working at all. Control-space seems to make the current window go out of focus, but I can't find it in the cinnamon control center. I would like to know how to disable it for use with synapse or kupfer, as I don't need this cinnamon Control-space anyway. I run cinnamon 2.0.10, in case it helps.


Fedora 15 doesn't automatically launch the browser when server starts up?

When I start up the ring jetty server, Fedora 15 doesn't launch the browser as it does in Fedora 14. Instead, it launches a new window in which I couldn't see the address bar and other stuff. Furthermore, Fedora 15 has a browser named Konqueror (instead of Firefox) as default, and I installed Firefox also. How can I fix it?


Arch Linux - connect: Network is unreachable

After 5 unsuccessful Arch Linux installations, I've got two that installed correctly. The first time, the network worked fine, and I was even installing it over SSH. After booting from the installed system instead of the live CD, it can't connect to the network, I get the following message when I try to ping anything, even my router: > connect: Network is unreachable I've tried installing Arch again, because nothing on the internet seemed to fix my issue. After installing, I'm getting the same issue. It appears it's failing to start eth0 because it times out.


Why can I still log in via SSH (PAM Auth) while `shutdown -k` is active?

Pretty straight-forward. Does SSH ignore the `nologin` file created by `shutdown -k TIME`? Using PAM Auth to sync password database to users; if that makes a difference.


Delete files in a directory which are also in another directory

I copied a directory using this:               cp -r dir/ ../../      without thinking and realized that it copied the contents of `dir` instead of actually `dir` to the above directory. Now I have a mess of files I need to delete so I can redo the `cp` correctly. How can I delete all the files that I mistakenly copied over if they don't match anything in particular?


My laptop cannot adjust brightness

I have a problem adjusting my laptop's brightness. This is a hardware problem but I can solve it with `ccsm`, but other programs do not work for me, e.g., `xgamma`, etc. Now I am running Fedora 15 and Gnome3 I cannot use compiz: is there another solution?


Good "progress bar" about md5sum checking progress?

I'm using this right now:               time md5sum -c *.txt | pv | grep -v ': OK$'      but aren't there any smart solutions that can list that how many files haven't been checked? I mean I have many md5sum's in .txt files in a dir, and I need to check them, but it would be a good thing to know that how much files are left to scan.. p.s.: so it's not really a progress bar, just a counter that output how many files are there left to "md5sum -c FILENAME"..


What roles do DAC (file permissions), ACL and MAC (SELinux) play in Linux file security?

I need some clarification/confirmation/elaboration on the different roles DAC, ACL and MAC play in Linux file security. After some research from the documentation, this is my understanding of the stack:   1. SELinux must allow you access to the file object.    2. If the file's ACLs (e.g., `setfacl`, `getfacl` for an ACL mount) explicitly allows/denies access to the object, then no further processing is required.   3. Otherwise, it is up to the file's permissions (rwxrwxrwx DAC model). Am I missing something? Are there situations where this is _not_ the case?


ImageMagick to detect numbers

I was curious to know if ImageMagick can detect numbers in an image? What is the best way to code for this if it can be done? If ImageMagick cannot do it is there another way to detect numbers on an image? EDIT: Im not looking for an OCR program or to use an OCR program. I have used OCR through acrobat and if it is a unique truetype or opentype font the OCR process will destroy the image.


su and aliases confusion

I create an alias as my current user in the bash shell, which I can see using the alias command. When I switch user without the `-`, i.e. `su testuser`, the alias is not carried into the new user's environment. Any idea why?


lxc-unfreeze does not resume the guest if the host is rebooted

Does a guest that has been frozen with lxc-freeze survive a reboot of the host? I.e. after rebooting the host, can the guest be unfrozen with lxc-unfreeze?


Gnome-terminal slow to start from launcher, fast when started from terminal

I am using Ubuntu 10.04 with Gnome. When I start a Gnome-terminal (a frequent occurance) if I do it by clicking an icon on a panel (that has as the command: `gnome-terminal`) it takes a while--think multiple seconds on many occasions. If, however, I start it by typing `gnome-terminal` in another terminal it starts immediately. I am unsure how to investigate what is causing the slowdown, any suggestions? That is, I am very interested in how to solve this, but even more interested in how to investigate this effectively. Note 1: the behavior is not limited to starting gnome-terminal. Note 2: there are some other behaviors (other than starting programs) that are slower than I think they should be. These are varied and I don't have a good description.


Program to track  and analyze usage

I would like to get my computer usage statistics (what programs I ran, for how long and etc. More is better). I used to use wakoopa but I'm not willing to throw statistics out to the web. I've tried hamster but I always forgot/haven't set tracking time. Any suggestions?


How to troubleshoot udev not creating /dev/hda3 on gentoo boot?

My old gentoo laptop seem to have an issue with udev probably due to me updating software using `emerge`, upgrading udev+kernel, getting some messages "do these things after upgrading udev/kernel" and thinking "I'll look into the screen output, read those messages and take care of those things later before ever rebooting the system". Unfortunately, being a bit in a hurry, I did, of course, forget to review those messages, shut down the machine, moved it physically to it's now location at home and started up, only to be greeted with a failure to find `/dev/hda3`. Now I have managed to work around that (described in length below) by manually creating `/dev/hda3` and then making `init` continue the system boot but I need some advice on how to proceed on fixing this once and for all (so I don't have to repeat the procedure belown on every boot). (If anyone can point to somewhere Gentoo machine where I can find all post- install messages for the packages I have installed, then I can find those instructions related to udev and the kernel which I should have read.) Relevant software versions: Gentoo-hardened-kernel 2.6.36-r6 (preferable) and 2.6.28-r9 (used for 21 months before shutdown). The cumbersome manual startup process described below has been verified to work for both kernel versions. The udev package is udev-151-r4. When booting up everything seems to be fine (the machine start's the kernel, it mounts /proc, /sys and /dev, starts udevd and populates /dev based on uevents, processes the uevents, mounts /dev/pts) until it comes to the step of 'Checking root filesystem'. There it emits `Failed to open the device '/dev/hda3': No such file or directory` Then it asks me for root password (or Ctrl-D to continue). I enter that, and in the shell, `mount` tells me that `rootfs` is mounted on and that `/dev/root` also is mounted on `/`. Also, `mount` complains that `/etc/mtab` is not writable (e.g read/only filesystem). All of this makes sense to me, given that the bootup is not completed. Doing `ls /dev` reveals that there are no `hda`, `hda1`, `hda2` or `hda3` devices, which normally should be there (and which I would expect udev to create). Also worth mentioning, `/dev` contains no `sda`, `sda1`, `sda2` or `sda3` devices either, so we are not seeing the issue of an updated udev or kernel changing it's convention of what to call different disk devices. Neither is there any `/dev/disk` directory where disk devices could "hide". So my next, potentially dirty, step is to manually create `hda`, `hda1`, `hda2` and `hda3` under `/dev` (I had a sneak peek at one of my other gentoo servers to figure out major and minor numbers as well as appropriate permissions and group membership): `mknod /dev/hda b 3 0   mknod /dev/hda1 b 3 1   mknod /dev/hda2 b 3 2   mknod /dev/hda3 b 3 3   chmod 660 /dev/hda*   chgrp disk /dev/hda*` Unfortunately, doing Ctrl-D or writing `exit` here will not continue the interrupted boot sequence, but instead it will initiate a reboot (which brings the machine up to the state of `/dev/hda` not found), so _that_ path to solving this issue won't help, unfortunately. Another workaround I tried (which failed) where to press 'I' (as well as trying 'i') as soon as `init` started and began to run the various init scripts (like mounting /proc, /sys and so on) but I never manage to enter interactive boot mode before the boot sequence reaches the (failed) attempt to check /dev/hda3. Instead I continue with using my `/dev/hda3` device to mount my OS filesystem:   `mount -o remount -o rw /dev/hda3 /` So, now I have write access to the file system of my machine which gives me _some_ options regarding troubleshooting this situation: amending configuration files, starting various init-scripts and subsystems etc. One thing that does _not_ work is to change run-level though. The reason is that `init 3` fails with the error message `init: /dev/initctl: No such file or directory`. Again I do a sneak peek on my other Gentoo server and finds out that `/dev/initctl` is a pipe with permissions `600` and belonging to `root:root`, so I recreate that: `mknod /dev/initctl p chmod 600 /dev/initctl` Now `init 3` fails, but a little differently; it hangs for a while and then gives up with the message `init: timeout opening/writing control channel /dev/initctl`. This makes sense as the original `init` process (with process id 1) does not have this freshly created `/dev/initctl` opened for reading. Now, reading the `init` man page I realize that sending `SIGUSR` will make `init` close and reopen `/dev/initctl`. _Exactly_ what I need, so I execute the command `kill -l` to get a list of all signals and their number (in which I see that `SIGUSR1` has the number 10) then I issue the command   `kill -10 1`   to make `init` reopen `/dev/initctl`, then I retry entering run level 3:   `init 3` Now `init` tries to enter runlevel 3 and executes a large number of scripts. Unfortunately, all those scripts fails with `ERROR: cannot run syslog-ng until sysinit completes`. So, I reboot the system (which now actually works as expected as I've made `init` listen to `/dev/initctl`: I logon as `root` and then issues `reboot`), repeats the above steps (except for remounting `/dev/hda3` as writable) up to and including the point of sending `SIGUSR1` to `init`. Now I am trying to make `init` resume the boot sequence but in a more gentle way, by making it reread the `/etc/inittab` file: `init q` _Nothing_ seem to have happened. So, I'll investigate `/etc/inittab` where I find an entry for a runlevel which seem to called `sysinit`. I take the risk and rerun that: `init sysinit` This time `init` complains with a usage message. Reading `/etc/inittab` again, I see that the `sysinit` entry makes a call to `/sbin/rc` with the argument `sysinit`. So, I decide to try _that_ : `/sbin/rc sysinit` _Now_ the system retries to boot up a number of services _and succeeds!_ Not only that, when re-running the init scripts for mounting `/proc`, `/sys` and `/dev` there is a check made to see if they already are mounted (a testament of how valuable it is to do sanity checks and error checks in code and act accordingly when running into exceptional circumstances). Happy with this, I decide to also run the commands for the `/etc/inittab` entry `bootwait`, as that one as well is missing a runlevel letter or digit. `/sbin/rc boot` Again, a number of init scripts are started, mainly for networking. No unexpected errors are reported, so I'm happy to retry getting to runlevel 3: `init 3` Once the initscripts have finished, the machine is up and I can logon as root (and, in theory, fix the root cause of this mess)!


Opening port 80 but remain secure

I have a standard installation of Ubuntu 10.04, and have installed the LAMP stack so I can do some web development locally. On my router I have opened port 80 so I can develop with external services like paypal and facebook, as they need to see the website for them to work. How unsecure has my development machine become by opening port 80? Can I secure it further, yet leave port 80 open? I am asking this quesiton because on my apache error.log file, I noticed an external ip address trying to access webdav, which I do not have setup. I have yet to check the access.log file.


Find unversioned files in CVS checkout

CVS doesn't list **unversioned files** in the status output by default, so how can I get a list of all unversioned files? This is the best I've come up with so far:               while IFS= read -r -d '' -u 9     do         2>/dev/null cvs status "$REPLY" | >/dev/null grep Unknown && echo "$REPLY"     done 9< <( find . \( -type d -name CVS -prune -false \) -o -type f -print0 )      Surely there must be a simpler way?


How do I refresh Gnome 3 applications

I just added and modified a .desktop file in my /home/user/.local/share/applications folder. Is there any way to refresh the icon and caption in the list of applications without logging out?


Daemons not starting during the boot on PUIAS (RedHat) 6.4

I am total Linux n00b entrusted with bunch of PUIAS (RedHat) 6.4 servers and desktops. I noticed after rebooting my computing nodes (done just for testing purposes) that many of the daemons which are started manually after initial installation (ipmi, mcelog, fail2ban) are not running and have to be restarted manually. This server is suppose to run on the run level 3 (no GUI). Similar exercise on the same OS version on the desktops (run level 5) produces totally different outcome. Namely all daemons are properly started. Is this excepted and should I edit /etc/init.d scripts or maybe just write mine which will start services? Is there the other "correct" way of doing this? I am coming from OpenBSD world where build in daemons are simply stared by editing /etc/rc.conf.local and all other daemons are started by editing /etc/rc.local.


Aptitude Search reports package installed, while Aptitude Show reports it not installed - how is that possible?

me@friedly_server:~$ aptitude search samba-tools     i   samba-tools                                      - Samba testing utilities                                    me@friendly_server:~$ aptitude show samba-tools     Package: samba-tools                          New: yes     State: not installed     Automatically installed: no     Version: 2:3.6.6-3     Priority: optional     Section: net     Maintainer: Debian Samba Maintainers <pkg-samba-maint@lists.alioth.debian.org>     Uncompressed Size: 34.5 M     Depends: libacl1 (>= 2.2.51-8), libattr1 (>= 1:2.4.46-8), libc6 (>= 2.10),     libcap2 (>= 2.10), libcomerr2 (>=          1.01), libcups2 (>= 1.4.0), libgssapi-krb5-2 (>= 1.10+dfsg~), libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3          (>= 1.10+dfsg~), libldap-2.4-2 (>= 2.4.7), libpam0g (>= 0.99.7.1), libpopt0 (>= 1.14), libreadline6 (>=          6.0), libtalloc2 (>= 2.0.4~git20101213), libtdb1 (>= 1.2.7+git20101214), libtinfo5, libwbclient0 (>=          2:3.6.0~pre3), zlib1g (>= 1:1.1.4)     PreDepends: dpkg (>= 1.15.6~)     Conflicts: samba4, samba4-testsuite     Description: Samba testing utilities      Samba is an implementation of the SMB/CIFS protocol for Unix systems, providing support for cross-platform file      and printer sharing with Microsoft Windows, OS X, and other Unix systems.            This package contains extra command-line tools such as smbtorture for performance-testing CIFS servers and      clients.     Homepage: http://www.samba.org      So, does the 'i' mark in aptitude search contradict to "aptitude show"'s report? Or I don't understand something about that mark's meaning?


Where has my `uniq` or `sort -u` line gone, with some unicode characters

What is going on in the following code snippet? I'm not getting my expected output. I'd think it was a bug, but it happens for 2 different programs (uniq and sort), so I suspect it is something to do with... well, I don't know what.. hence the question. The first 3 (of 4) examples work, but the 4th fails!. I would expect the same behaviour for any and all characters.   ie. to print out 2 lines (from the 3 lines of input)... but in the 4th case, I only get 1 line (for both `sort -u` and `uniq`); the two identical lins just vanish! I've converted the output '\n' to space for compactness of view. I'm using _uniq_ and _sort_ from (GNU coreutils) 7.4 ... running on Ubuntu 10.04.3 LTS desktop. The script:               {       locale -k LC_COLLATE       echo       for c1 in x 〼 ;do          for c2 in z 〇 ;do            echo -n "asis   : "; echo -e "$c1\n$c2\n$c2"          |tr '\n' ' ';echo           echo -n "uniq   : "; echo -e "$c1\n$c2\n$c2" |uniq    |tr '\n' ' ';echo           echo -n "sort -u: "; echo -e "$c1\n$c2\n$c2" |sort -u |tr '\n' ' ';echo           echo         done         echo       done     }      The output:               collate-nrules=4     collate-rulesets=""     collate-symb-hash-sizemb=2081     collate-codeset="UTF-8"          asis   : x z z      uniq   : x z      sort -u: x z           asis   : x 〇 〇      uniq   : x 〇      sort -u: 〇 x                asis   : 〼 z z      uniq   : 〼 z      sort -u: 〼 z           asis   : 〼 〇 〇      uniq   : 〼      sort -u: 〼           # In the last example (of 4) where did the '〇' go? .. U+3007 IDEOGRAPHIC NUMBER ZERO     #


Multiple PCs network centralized system authentication

(I couldn't really choose an accurate title as I don't know exactly what the feature I'm looking for is called. Sorry about that. I hope that the following lines may clear this aspect.) I own a dozen PCs, mostly running UNIX-based OSes (FreeBSD and various flavors of GNU/Linux), with a few running Windows 7 or Windows XP. I'd like to begin centralizing all my data on one machine running FreeBSD as well as acting as my NAS with ZFS. Furthermore I'd like to have a central system to manage users, password, groups that are common to some (or all) of my machines. Basically I'd like to edit my password on the master server and then being able to login on any of my PCs using the new password (without needing to update dozens of times the same user's password). I think as far as this goes that's what LDAP (or maybe even Kerberos?) does, though I'm not sure about the Windows support. **My questions are the following**   1. What should I use for a home-based environment with 1-3 human users (beside all UNIXes users like root, ...)? LDAP / Kerberos / Windows Server 2008?   2. Does (the one on point 1.) support Windows 7 / Windows XP acting as client? **I already plan to** mount shares on each PC I work on via Samba, which would provide a centralized and redundant data storage. I hope I explained in a clear way what I'd like to do. I'm sorry if I got some technical terms wrong. Please don't hesitate to reply or ask for clarifications.


grep change of line followed by a variable

I have a file of the following form (with '-' serving as delimiters), and I want to find the appearance of a number only when it follows a delimiter. I suppose it's a concatenation of grep '-\n' and $number, but I can't find the way to do it right. thanks..               1400     2     132     342     -     76567     1     1234     -     87     2     1400     54     -


Connecting to a WPA2 LAN on Ubuntu with Fluxbox

I'm trying to connect to a new network with Ubuntu 12.04 and fluxbox, and I'm not sure how to get it working. In the fluxbox menu there aren't any wlan- tools or network-manager, and since I'm not on the network I can't install any additional programs like wlan_radar. Is there a terminal way to do network scans and connect with a WPA2 password?


Performance difference between stdin and command line argument

For some commands, it is possible to specify certain input as either stdin or a command line argument. Specifically, suppose `command` can take stdin input and a filename as command line argument, and `command < myfile`, `cat myfile | command` and `command myfile` can produce the same result. For example, When the command is `sed`:               sed s/day/night/ <myfile >new        sed s/day/night/ myfile >new         cat myfile | sed s/day/night/ >new      When the command is `cat`:               cat < myfile     cat myfile        1. I was wondering if there are some general rules about their performances, i.e. which one of them is usually the most efficient, and which the least?   2. Is redirection always better than pipe?


Error while trying to retrieve dwm sources

I am trying to build `dwm` from source. Grabbing the source doesn't work:               (28) $ apt-get source dwm     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: You must put some 'source' URIs in your sources.list      This is my `sources.list` file:               ## CRUNCHBANG     ## Compatible with Debian Wheezy, but use at your own risk.     deb http://packages.crunchbang.org/waldorf waldorf main     deb-src http://packages.crunchbang.org/waldorf waldorf main          ## DEBIAN     deb http://ftp.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.debian.org/debian/ wheezy main contrib non-free          ## DEBIAN SECURITY     deb http://security.debian.org/ wheezy/updates main     #deb-src http://security.debian.org/ wheezy/updates main      What URL(s) should I put in my `sources.list` to get `apt-get source dwm` to work?


Extract integers enclosed in round brackets

I'm new to Linux. I've a file which contains list of movie names and their release year. I want to list out all release years. Specifically my file looks like below > >     TDKR(2012)   >     Vicky Cristina Barcelona (2008)   >     ... >   I tried grep with regex as follows               grep "^.*\\([0-9]*\\)$" movie.txt      and it works but it is printing entire line I want only years. Can I do it with `grep`?


XFCE on Debian: hiding block devices

I'm running XFCE 4.8 on Debian Wheezy and I can't find a clean way to hide a block device (system's SATA/SSD drive) on the desktop, but still be able to see `/` mount removable devices via Thunar. The latter means I'm aware of the "Removable Devices" on the Desktop Properties menu ;) My root filesystem is mounted from `/dev/sda1` but for an unknown reason the device appears as unmounted on the desktop. The corresponding line on the `/etc/fstab` file is:               UUID=6afe1aa9-1768-47ed-0d4b-b030f0318766 / ext4 defaults,commit=600,noatime,discard,errors=remount-ro 0 1      Before using the disk's UUID, it was simply declared as `sda1` and I had the same result. Reading all the answers all around the web, these are the 2 options widely used :               $ pwd     /etc/udev/rules.d     $ cat 99-hide-partitions.rules # with udisks1     KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1      or               $ cat 99-hide-partitions.rules # with udisks2     KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"      Then make `udev` refresh its rules by running `# udevadm trigger`. Unfortunately, none of those make the device disappear from the desktop. Of course I already tried rebooting. The `udev` properties are taken into account as shows the following command:               sudo udevadm info --query=all -n /dev/sda1|grep HIDE       E: UDISKS_PRESENTATION_HIDE=1      `UDISKS_IGNORE` has no effect in this context as Debian wheezy is shipped with `udisks` v1 which still supports `UDISKS_PRESENTATION_HIDE`. Am I hitting an XFCE/Thunar bug or am I missing something?


Clone OS to a smaller drive

I would like to copy/clone/move my CentOS (which is on a 20GB hard drive) to a smaller hard drive (5GB)... Can someone tell me how to do this?


Padding day / time values to ensure 3 digit length

I have a script which renders timestamps in the format YYYY'DDD'TTT where Y = year, D = day out of 365 and T = time in 1000th's of the day:               #!/bin/bash     clear     s=$(($(date +"%H*3600+%M*60+%S")))     t=$(($s * 5 / 432))     d=$(date +%j)     y=$(date +%Y)     printf "$y\`$d\`$t" "$y" "$d" "$t"      but I need to modify it so that D and T will always produce a three-character value (ie, '001' instead of '1' for Jan 1, '001' instead of '1' for the first minute of the day) - and I have no idea how. Any help is hugely appreciated


How to "jail" a user account's network capabilities on Linux?

Linux box `a` is connected to a home DSL line with dynamic DNS registration, hosting a `tmux` session to which multiple clients connect in read-only mode over SSH. All users connect using the same credentials: user `b`.               Example: ssh b@a.dynip.org tmux attach -t screencast      It all works fine but I have had a user do "naughty" stuff from the box out to the Internet. That's unacceptable as I am responsible for my Internet contract with the ISP; how do I completely jail every user apart from granting the ability to use the account `b`, over `ssh`, using `tmux` to watch session `screencast` on my `a` machine? I am thinking about updating ipchains straight after a user connects over ssh, allowing traffic back to that ip address only but... with multiple viewers sharing the same account?


How to decrypt single EncFS encrypted files?

Is it possible to decrypt single EncFS encrypted files with access to .encfs6.xml configuration file and without the proper directory structure it was created? With a little help from google I found this comment on a blog post: > http://pragmattica.wordpress.com/2009/05/10/encrypting-your-dropbox- > seamlessly-and-automatically/ > > Comment by Spence — August 14, 2009 @ 11:44 pm | Reply > > I did some reading on this, and without the metadata information included in > the .encfs6.xml file, it is impossible to decrypt ANY of the files. If you > wanted to decrypt a single file, you would at least need to have a directory > with that file, and then the encrypted file that you wanted, with all of the > proper directory structure. I haven’t played with this much myself, but I > think it might be possible to mount something set up like that, and then you > could get at the file. However, since the filename is encrypted, you > wouldn’t know which file to download from Dropbox > > There is a debug utility that you can use on the command-line to get the > decrypted filenames of files, and possibly decrypt them as well, so the > situation isn’t hopeless. It would probably just take a lot of playing > around to figure this stuff out. If you do invest the time and figure some > of this out, maybe write a post about it on your blog and link to it here. Any suggestions?


Move Web Directory to Raid Array

I want to improve the performance of a web application running on Apache, so I created a Raid Array on /dev/md0. Now I need to figure out how to move the application to the array and make sure that Apache will still serve it when someone accesses my domain. > Web application is in the directory: /var/www/html - Raid Array device is: > /dev/md0 How do I make the application run on the array?


Lxpanel sometimes freezes

I'm using Fedora 15 and the latest LXDE. From time to time I see that `lxpanel` freezes or maybe faults down such that I can't click anywhere except opened application icons. `lxpanelctl restart` works well, but how can I fix this bug?


Route VPN Through Proxy

I'm on a network which requires out-going traffic to pass through an http proxy. I would like to connect to my remote VPN through the proxy, but am not sure how to do this. Any thoughts? I am running Lubuntu with the "network-manager-vpnc" installed.


Using join with two files fails on larger file sizes

I am having some issues with a script that is using join to join two files. Eaxmple input files contains lines like this: Here are the input file and the output of the join command:               D:\work\BuildScripts\3C>cat D:\temp\aaa.txt     hzapplications\adn\adn4\adn4density\adn4_idd_module.cpp,83     hzapplications\adn\adn4\adn4density\adn4dencalmodule.cpp,73     hzapplications\adn\adn4\adn4density\adn4denimagemodulerm.cpp,111     hzapplications\adn\adn4\adn4density\adn4denimagemodulert.cpp,202     hzapplications\adn\adn4\adn4density\adn4densityanqmodules.cpp,445     hzapplications\adn\adn4\adn4density\adn4densityappl.cpp,378     hzapplications\adn\adn4\adn4density\adn4densityappl.h,50     hzapplications\adn\adn4\adn4density\adn4densityevrmodules.cpp,272     hzapplications\adn\adn4\adn4density\adn4densitykernel.cpp,490     hzapplications\adn\adn4\adn4density\adn4densitykernel.h,65     hzapplications\adn\adn4\adn4density\adn4densitysecimgmodule.cpp,209     hzapplications\adn\adn4\adn4density\adn4densitysecimgmodule.h,70     hzapplications\adn\adn4\adn4density\adn4densitysecmodule.cpp,218     hzapplications\adn\adn4\adn4density\adn4densitysecmodule.h,70     hzapplications\adn\adn4\adn4density\adn4dphimodules.cpp,610     hzapplications\adn\adn4\adn4density\adn4dphimodulesrt.cpp,115     hzapplications\adn\adn4\adn4density\adn4rhomodulesrt.cpp,102          D:\work\BuildScripts\3C>cat D:\temp\bbb.txt     hzapplications\activect\ptc\ictsx01\ictsx01_bootuptask.cpp,1     hzapplications\activeps\iola\acquisition\iola_acqmodule.cpp,4     hzapplications\activeps\iola\simulation\iola_simmodule.cpp,3     hzapplications\activeps\iolr\simulation\iolr_simmodule.cpp,1     hzapplications\activeps\iolr\task\iolr_poweron200vhitask.cpp,1     hzapplications\activeps\iolr\task\iolr_poweron200vlowtask.cpp,1     hzapplications\activeps\iolr\task\iolr_poweronnrlvtask.cpp,1     hzapplications\activeps\iolr\task\iolrtaskcommon.cpp,2     hzapplications\adn\adn4\adn4density\adn4densitykernel.cpp,1     hzapplications\adn\adn4\adn4equipment\adn4adseelem.cpp,1     hzapplications\adn\adn4\adn4equipment\adn4collar.cpp,1     hzapplications\adn\adn4\adn4equipment\adn4tool.cpp,2     hzapplications\adn\adn6c\adn6cequipment\adn6ccollar.cpp,1     hzapplications\adn\adn8\adn8equipment\adn8tool.cpp,1     hzapplications\adn\adn8\adn8neutron\adn8neutronkernel.cpp,1     hzapplications\adn\adn8d\adn8ddensity\adn8ddensitykernel.cpp,1     hzapplications\adn\adn8d\adn8dequipment\adn8dtool.cpp,1          D:\work\BuildScripts\3C>join --ignore-case -1 1 -2 1 -t"," -o "1.1,1.2,2.2" -e "0" -a 1 D:\temp\aaa.txt D:\temp\bbb.txt     hzapplications\adn\adn4\adn4density\adn4_idd_module.cpp,83,0     hzapplications\adn\adn4\adn4density\adn4dencalmodule.cpp,73,0     hzapplications\adn\adn4\adn4density\adn4denimagemodulerm.cpp,111,0     hzapplications\adn\adn4\adn4density\adn4denimagemodulert.cpp,202,0     hzapplications\adn\adn4\adn4density\adn4densityanqmodules.cpp,445,0     hzapplications\adn\adn4\adn4density\adn4densityappl.cpp,378,0     hzapplications\adn\adn4\adn4density\adn4densityappl.h,50,0     hzapplications\adn\adn4\adn4density\adn4densityevrmodules.cpp,272,0     hzapplications\adn\adn4\adn4density\adn4densitykernel.cpp,490,0     hzapplications\adn\adn4\adn4density\adn4densitykernel.h,65,0     hzapplications\adn\adn4\adn4density\adn4densitysecimgmodule.cpp,209,0     hzapplications\adn\adn4\adn4density\adn4densitysecimgmodule.h,70,0     hzapplications\adn\adn4\adn4density\adn4densitysecmodule.cpp,218,0     hzapplications\adn\adn4\adn4density\adn4densitysecmodule.h,70,0     hzapplications\adn\adn4\adn4density\adn4dphimodules.cpp,610,0     hzapplications\adn\adn4\adn4density\adn4dphimodulesrt.cpp,115,0     hzapplications\adn\adn4\adn4density\adn4rhomodulesrt.cpp,102,0          D:\work\BuildScripts\3C>      The expected output is that this particular line is joined like so: hzapplications\adn\adn4\adn4density\adn4densitykernel.cpp,490,1 Any suggests are most welcome. I am using the unxutils package on windows, this is the exact version:               D:\work\BuildScripts\3C>join --version     join (GNU textutils) 2.0     Written by Mike Haertel.          Copyright (C) 1999 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Get an error with apt-get trying to install pidgin

I'm running this as a debian wheezy inside a vm with NAT networking with a win7 host. When I try to install pidgin using               sudo apt-get install pidgin      I get following error               Err http://security.debian.org/ wheezy/updates/main pidgin amd64.2.10.9-1~deb7u1   403  Forbidden      Failed to fetch http://security.debian.org/pool/updates/main/p/pidgin/pidgin_2.10.9-1~deb7u1_amd64.deb     403  Forbidden E: Unable to fetch some archives, maybe run apt-get     update or try with --fix-missing?      As mentioned I tried to execute               sudo apt-get update     #and     sudo apt-get --fix-missing update      And get               errors: Ign ftp.uk.debian.org wheezy-updates/main amd64 Packages/DiffIndex Err dl.google.com stable/main amd64 Packages 403 Forbidden     E: Some index files failed to download. They have been ignored, or old ones used instead      My `sources.list` includes the following lines + some internal ones:               deb http://http.debian.net/debian wheezy main     deb-src http://http.debian.net/debian wheezy main          deb http://http.debian.net/debian wheezy-updates main     deb-src http://http.debian.net/debian wheezy-updates main          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main      ### Edit > ping 8.8.8.8 or google.com results in no reply I old tried changing my sources to use .de instead of .uk but the same issue Update_ ** ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ ____**- after trying on a new vm inside linux mint I am still having issues. I had a look at /etc/resolve.conf and I have the following settings:               domain home     search home     nameserver 10.0.2.3      however on my host I have:               nameserver 127.0.1.1     search home