skanx  [ Profile ]

Sort by: Date / Title /

  1. 2 years ago
    time command > timelog doesn't work, because time outputs to stderr
    time command 2> timelog doesn't work either, because time actually is a bash keyword, and it's always run in a subshell
    
    Redirecting the output of time can be achieved by executing the whole command in a block, then redirecting its output:
    { time command; } 2> timelog
    
    Note: Linux also provides a time binary (/usr/bin/time), but with a different output (and might be less efficient ?)
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/803"></script>
  2. 2 years ago and saved by 1 other
    tasklist -> ps
    
    taskkill -> kill
    (taskkill /PID <pid>)
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/776"></script>
  3. 2 years ago
    $ openssl pkcs12 -in pkcs12file.p12 -out pemfile.pem
    (by default, pkcs12 will ask for an import password, to decrypt the p12 file (just press Enter if you don't have a password), and finally a passphrase to encrypt your key)
    
    pemfile.pem now contains your CA certificate, your client certificate, and your (encrypted) key.
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/769"></script>
  4. sponsorised links
  5. 2 years ago
    Lock a database:
    $ mysql -u user -p
    mysql> FLUSH TABLES WITH READ LOCK;
    This closes all open tables and locks all tables for all databases with a read lock until you execute UNLOCK TABLES.
    
    Unlock:
    mysql> UNLOCK TABLES;
    
    (to lock a single table: LOCK TABLES table READ;)
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/745"></script>
  6. 2 years ago
    sudo dscacheutil -flushcache
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/743"></script>
  7. 2 years ago and saved by 1 other
    quick & dirty...
    openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
    
    hint: to generate a wildcard certificate for multiple name-based virtualhosts, use *.domain.tld as the common name.
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/648"></script>
  8. 2 years ago
    Apple Mail keeps a lot of junk in a SQLite database named Envelope Index. Since it's a database, it tends to grow with time, and deleted records are not handled very efficiently. You might want to clean it a bit from time to time, and Mail might even seem a little faster after that.
    
    1. Quit Mail
    
    2. Launch a terminal, and type this command :
    
    sqlite3 ~/Library/Mail/Envelope\ Index vacuum
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/553"></script>
  9. 2 years ago and saved by 1 other
    You run apt-get update, and it complains about some missing key IDs:
    
    W: There is no public key available for the following key IDs:
    B5D0C804ADB11277
    W: GPG error: http://volatile.debian.org etch/volatile Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EC61E0B0BBE55AB3
    W: You may want to run apt-get update to correct these problems
    
    B5D0C804ADB11277 and EC61E0B0BBE55AB3 are the missing gpg pub keys. Fetch them with gpg, and import them into apt :
    
    gpg --keyserver subkeys.pgp.net --recv-key B5D0C804ADB11277
    gpg -a --export B5D0C804ADB11277 | apt-key add -
    apt-get update
    
    OR (new and improved!)
    
    apt-key advanced --keyserver subkeys.pgp.net --recv-keys B5D0C804ADB11277
    apt-get update
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/529"></script>
  10. 2 years ago and saved by 2 others
    - Stop mysql
    # /etc/init.d/mysql stop
    
    - Lauch mysql with --skip-grant-tables (WARNING: your mysql server will launch without any password authentication, so please protect it first with a firewall or something if it's world accessible)
    # mysqld_safe --skip-grant-tables
    
    - Login as root without a password
    $ mysql -u root
    
    - Change the password
    mysql> use mysql;
    mysql> update user set password=PASSWORD("your_new_root_password") where User='root';
    mysql> flush privileges;
    mysql> quit
    
    - Stop mysql
    # /etc/init.d/mysql stop
    
    - Start mysql again to re-enable authentication
    # /etc/init.d/mysql start
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/357"></script>

First / Previous / Next / Last / Page 1 of 1 (9 posteets)