I would like some help getting a script to run on shutdown and restart.  Following advice I found online, I created the script and placed it in /etc/rc0.d and /etc/rc6.d.   Unfortunately, the scripts are not running and when I run Aptitude, I see the following error appear:  insserv: warning: script is corrupt or invalid: /etc/init.d/../rc0.d/K99-CreateSuccessfulPowerOffFile insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/K99-CreateSuccessfulPowerOffFile   Here are the contents of the script:  #!/bin/sh echo success &gt; /etc/poweroffsuccess.txt exit 0   And here are the permissions:  user@hostname:~$ ls -l /etc/rc0.d/K9* -rwxrwxrwx 1 root root 58 Sep 24 11:11 /etc/rc0.d/K99-CreateSuccessfulPowerOffFile  user@hostname:~$ ls -l /etc/rc6.d/K9* -rwxrwxrwx 1 root root 50 Aug 18 21:09 /etc/rc6.d/K99-CreateSuccessfulPowerOffFile
I'd like to run a .sh file using bash on logout and shutdown of Ubuntu. I have searched up and down the web and have found only fixes for KDE and GNOME. The script is simple, I just need to know if I can add the line of code to the "logoff/shutdown" file or if I need to reference it in another script.
Learning Regular Expressions I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them? How to exclude files from Visual Studio compile? I'm in the process of refactoring a project.  I've got an entire subfolder which is known to be broken.  Is there any declarative way to exclude that folder from the compile temporarily while I test the refactoring thus far?  I realize I could delete the folder, but I'd like to do this through configuration if possible. MathJax isn't currently working on the Android app, which makes it totally useless for the 'technical' sites like  or .  For example, in the Android app:    Same post in a (mobile) browser:     Please add this functionality! How to copy only file attributes (metadata) without actual content of the file? How to list the tables in a SQLite database file that was opened with ATTACH? What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the ATTACH command on the SQLite 3 command line tool? Content type permission to specific users How do I set content permission so that specific content types become visible/usable to the admin user only, while other content types may be visible by other user roles?  After I added new content types, I checked the rebuild permissions.   Content access is working fine but the problem seems to be the fact that the enw content types aren't made visible / accessible to the other roles... Produce an explicit bijection between rationals and naturals? In my preamble, you'll find:  \renewcommand{\baselinestretch}{1} \renewcommand{\familydefault}{\sfdefault} \usepackage[sfmath]{kpfonts} \usepackage[mathrmOrig]{sfmath} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{animate} \usepackage{anysize} \usepackage{arcs} \usepackage{array} \usepackage[scale=0]{background} \usepackage{blindtext} \usepackage{calc} \usepackage{cancel} \usepackage{chngcntr} \usepackage{CJK} \usepackage{CJKspace} \usepackage{CJKpunct} \usepackage{colortbl} \usepackage{enumitem} \usepackage{epstopdf} \usepackage{etoolbox} \usepackage{fancybox} \usepackage{fancyhdr} \usepackage{float} \usepackage{framed} \usepackage{graphicx} \usepackage{hyphenat} \usepackage{ifthen} \usepackage{latexsym} \usepackage{lmodern} \usepackage{multicol} \usepackage{multirow} \usepackage{mwe} \usepackage{pgffor} \usepackage{rotating} \usepackage{tabularx} \usepackage{textcomp} \usepackage{tgheros,tgtermes,tgcursor} \usepackage{tikz} \usepackage{times} \usepackage{tipa} \usepackage{varwidth} \usepackage{wasysym} \usepackage{wboiboites} \usepackage[abs]{overpic} \usepackage[breaklinks,colorlinks=true,linkcolor=red,citecolor=red, urlcolor=blue]{hyperref} \usepackage[framemethod=TikZ]{mdframed} \usepackage[breakable, theorems, skins]{tcolorbox,empheq} \usepackage[default]{gillius} \usepackage[document]{ragged2e} \usepackage[latin1]{inputenc} \usepackage[spanish]{babel} \usepackage[T1]{fontenc} \usepackage[total={18.59cm,26.5cm},left=1.5cm,top=2.5cm]{geometry} \usetikzlibrary{matrix,arrows, positioning,shadows,shadings,backgrounds,calc, shapes, tikzmark} \usetikzlibrary{shadows.blur} \usetikzlibrary{shapes.symbols} \usetikzlibrary{patterns,fadings} \tcbuselibrary{skins,breakable,listings,theorems}    I'm trying to draw an arrow for X axis and Y axis.   \begin{tikzpicture} \draw[yellow!10, fill=blue!5](-1, -1) rectangle (7, 5); \draw[dotted] (-0.75,-0.75) grid (6.75,4.75); \node[below] at (-0.25,0){$O$}; \draw[-&gt;,black, thick] (-0.75,0)--(6.75,0); \end{tikzpicture}   But I get this error:    Additionally, if I remove -> from the options of \draw the tikz picture compiles normally. Do I have to leave the Schengen area if I have a short term (C) visa that will expire right before my National Visa (D) officially starts? I am writing an article in English, with some pages in Russian.  \documentclass[12pt]{article}  \usepackage[T1,T2A]{fontenc}  \usepackage[utf8]{inputenc}  \usepackage[russian,english]{babel}  \usepackage{newtxmath} \usepackage{newtxtext} \begin{document}  hello \textbf{hello}  \selectlanguage{russian} привет \textbf{привет}  \end{document}   Output:  hello hello привет привет  I am using \selectlanguage{} to switch between languages when needed.  However, I noticed that when I try to use \textbf{} when in Russian language mode, it does not work because of newtxtext, which I am using for math formulas.  Does anyone know how to solve this problem?  Thank you. Hi is it possible to get images from go daddy  to visual force pages.if it possible can you explain clearly how the process is. I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection.     An illegal choice has been detected. Please contact the site administrator.   How do I overcome that error?       function dynamic_location_dropdown_form_alter(&amp;$form, $form_state, $form_id) {   if($form_id == 'product_node_form') {    $location_options = array();    if(isset($form['field_destination']['und']['#default_value'][0])) {     $destination = $form['field_destination']['und']['#default_value'][0];   }   else {     $destination = 0;   }    $location_options = dynamic_location_dropdown_locations($destination);    $form['field_destination']['und']['#ajax'] = array(     'event' =&gt; 'change',     'wrapper' =&gt; 'squadron-wrapper',     'callback' =&gt; 'dynamic_location_dropdown_ajax_callback',     'method' =&gt; 'replace',   );   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#prefix'] = '&lt;div id="squadron-wrapper"&gt;';   $form['field_product_location']['und']['#suffix'] = '&lt;/div&gt;';   $form['field_product_location']['und']['#options'] = $location_options;   } }  function dynamic_location_dropdown_ajax_callback($form, $form_state) {   $country_id = $form['field_destination']['und']['#value'];   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#options'] =  dynamic_location_dropdown_locations($country_id);    return $form['field_product_location']; }  function dynamic_location_dropdown_locations($destination_id) {   $nodes = array();   $nodes[''] = '- None -';   if($destination_id != '') {     $select = db_query("       SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created       FROM {node} node       LEFT JOIN {field_data_field_location_country} field_data_field_location_country        ON node.nid = field_data_field_location_country.entity_id        AND (field_data_field_location_country.entity_type = 'node'        AND field_data_field_location_country.deleted = '0')       WHERE (( (node.status = '1')        AND (node.type IN  ('location'))        AND (field_data_field_location_country.field_location_country_nid = $destination_id)))       ORDER BY node_title ASC     ");     $nodes[''] = '- None -';     foreach ($select as $node) {       $nodes[$node-&gt;nid] = $node-&gt;node_title;     }   }    return $nodes; } This might seem a stupid question but why do Ethernet cables have 8 wires? Cat5 cables were just using 4 of the 8 wires, so only 4 are actualy 'needed'. Why not 12 or 16 wires? Incredible frequency of careless mistakes How does java do modulus calculations with negative numbers? What is the difference between new/delete and malloc/free?  Related (duplicate?): Farkas/guards pursuing me glitch I was doing a quest for the companions. When I entered Jorrvaskr, Farkas pulled out his sword and began to talk to me. Every time I would try to leave the conversation he would just follow me and try to talk to me again. This lead to me paralyzing Farkas and running away.   By the time I got to the gates of Whiterun he had already gotten up, ran to me and started another conversation. I quickly made it to the gates and exited, he followed me through the gates but I whirlwind sprinted to Shadowmere then attempted to fast travel - which game me the "Can not fast travel when guards are pursuing you" message even though no guards were following me.   I knew Farkas wasn't far behind so I quickly jumped on a carriage and I traveled to the nearest hold which was Dawnstar. Now I can't leave Dawnstar because the same message appears. I have tried to pay off my debt to the Dawnstar guards but it didn't fix the problem. How can I resolve this issue? Put the book back on the table.   I'm having trouble. I think it is a preposition. Is there a cryptographic algorithm which is immune to side channel attacks? Is there any cryptographic algorithm immune to side channel attacks based on scan chain? In VLSI point of view. Is Angular Momentum truly fundamental? This may seem like a slightly trite question, but it is one that has long intrigued me.  Since I formally learned classical (Newtonian) mechanics, it has often struck me that angular momentum (and generally rotational dynamics) can be fully derived from normal (linear) momentum and dynamics. Simply by considering circular motion of a point mass and introducing new quantities, it seems one can describe and explain angular momentum fully without any new postulates. In this sense, I am lead to believe only ordinary momentum and dynamics are fundamental to mechanics, with rotational stuff effectively being a corollary.  Then at a later point I learned quantum mechanics. Alright, so orbital angular momentum does not really disturb my picture of the origin/fundamentality, but when we consider the concept of spin, this introduces a problem in this proposed (philosophical) understanding. Spin is apparently intrinsic angular momentum; that is, it applies to a point particle. Something can possess angular momentum that is not actually moving/rotating - a concept that does not exist in classical mechanics! Does this imply that angular momentum is in fact a fundamental quantity, intrinsic to the universe in some sense?  It somewhat bothers me that that fundamental particles such as electrons and quarks can possess their own angular momentum (spin), when otherwise angular momentum/rotational dynamics would fall out quite naturally from normal (linear) mechanics. There are of course some fringe theories that propose that even these so-called fundamental particles are composite, but at the moment physicists widely accept the concept of intrinsic angular momentum. In any case, can this dilemma be resolved, or do we simply have to extend our framework of fundamental quantities?